Wednesday, June 5, 2019

Activate generic document services (GOS) in transactions POP1/2/3

Unfortunately there is no secret key activating GOS as it exists for sales and distribution transactions. There are some performance reasons for that, so be careful.

https://launchpad.support.sap.com/#/notes/598073


If you really need it, follow below steps. So we are in general looking for something like VL03N has in standard.



All transactions POP1, POP2, POP3 use after inserting a packaging instruction main second screen number 610. So PBO action of this screen is the best candidate for  such enhancement.




Use transaction SWO1 to find out used object type.




Actual activation of generic document services is done by creating an instance of class CL_GOS_MANAGER with following params:

SAP Object         BUS3071
KeyField              PIKey


Create Enhancement implementation



Place it into new package




Note: Custom namespace does not work here.



Final enhancement




Tuesday, June 4, 2019

How to read certain status of the delivery

This is just tiny shot, that can save a time ;-) Of course you could check any output type in a similar way.


Method definition:

 METHODS:
    is_zrea_processed
        IMPORTING iv_vbeln                 TYPE string
        RETURNING value(rv_zrea_processedTYPE abap_bool. " Yes/No



Method implementation:

  METHOD is_zrea_processed.

    DATAlt_nast    TYPE STANDARD TABLE OF nast,
          lt_nastx   TYPE STANDARD TABLE OF nast,
          ls_key     TYPE msg1,
          lt_key     TYPE STANDARD TABLE OF msg1.

    ls_key-sign   'I'.
    ls_key-option 'EQ'.
    ls_key-low    iv_vbeln.
    APPEND ls_key TO lt_key.

    CALL FUNCTION 'RV_MESSAGE_READ'
      EXPORTING
        msg_kappl 'V2'
      TABLES
        msg_xnast lt_nastx
        msg_ynast lt_nast
        ri_objky  lt_key.

    FIELD-SYMBOLS<fs_nast> TYPE nast.
    READ TABLE lt_nast ASSIGNING <fs_nast> WITH KEY objky 'ZREA'.
    IF <fs_nast> IS ASSIGNED AND <fs_nast>-vstat EQ '1').
      rv_zrea_processed abap_true.
    ELSE.
      rv_zrea_processed abap_false.
    ENDIF.

  ENDMETHOD.                    "is_zrea_processed