2 Replies Latest reply: Mar 25, 2009 11:39 AM by Hafeez Abdul RSS

Processing log output for Purchase order

Hafeez Abdul
Currently Being Moderated

Dear All,

 

Iam getting some problem when iam creating an IDOC and checking in the Processing log for IDOC number.

 

Actually i had created one custom idoc for Purchase order since my client need only some field and in one line for header and line item, I had done it and i can see it in sdata of EDIDD structure. When i create a Purchase order and save it an idoc number is posting and I can see this file in my physical directory indeed.

 

Now when iam going into change mode of PO ME22n to see the Processing LOG, It is not showing the IDOC Number in Purchase order output processing log popup.

  • Re: Processing log output for Purchase order
    Martin Shinks
    Currently Being Moderated

    The processing log will only show output based standard output control (Table NAST).

     

    How is your IDoc being created. Via a user exit, BADI. If so then they will not appear on the processing log.

  • Re: Processing log output for Purchase order
    Hafeez Abdul
    Currently Being Moderated

    The processing log will only show output based standard output control (Table NAST).

     

    How is your IDoc being created. Via a user exit, BADI. If so then they will not appear on the processing log.

     

    It is being created as a custom IDOC for which i had written a Z function module and given that in PO processing code which is ME10. When iam checking the standard IDOC for PO it is generating the IDOC in processing log as well.

     

    Iam just placing my code just have a look at it and suggest if any thing needs to be done.

     

    FUNCTION Z_IDOC_OUTPUT_ORDERS.

    *"----


    ""Local Interface:

    *"  IMPORTING

    *"     VALUE(OBJECT) LIKE  NAST STRUCTURE  NAST

    *"     VALUE(CONTROL_RECORD_IN) LIKE  EDIDC STRUCTURE  EDIDC

    *"  EXPORTING

    *"     VALUE(OBJECT_TYPE) LIKE  WFAS1-ASGTP

    *"     VALUE(CONTROL_RECORD_OUT) LIKE  EDIDC STRUCTURE  EDIDC

    *"  TABLES

    *"      INT_EDIDD STRUCTURE  EDIDD

    *"  EXCEPTIONS

    *"      ERROR_MESSAGE_RECEIVED

    *"      DATA_NOT_RELEVANT_FOR_SENDING

    *"----


    DATA: xdruvo.                          "Druckvorgang

    DATA: neu  VALUE '1',                  "Neudruck

          h_kappl LIKE nast-kappl,         "Hilfsfeld Applikation

          h_parvw LIKE ekpa-parvw,         "Hilfsfeld Partnerrolle

          h_ebeln LIKE ekko-ebeln.         "Hilfsfeld Belegnummer

     

      CLEAR control_record_out.

       xdruvo = neu.

      h_kappl = object-kappl.

      h_ebeln = object-objky.

      h_parvw = object-parvw.

     

      DATA:

           LT_EDIDC LIKE EDIDC OCCURS 0 WITH HEADER LINE,

             L_EDIDC LIKE EDIDC,

             L_SEND_FLAG,

             W_SDATA LIKE EDIDD-SDATA.

      DATA: T_BDI_MODEL LIKE BDI_MODEL OCCURS 0 WITH HEADER LINE.

      DATA: T_EDIDC LIKE EDIDC OCCURS 0 WITH HEADER LINE.

      DATA: T_EDIDD LIKE EDIDD OCCURS 0 WITH HEADER LINE.

      DATA: C_MESSAGE_TYPE LIKE EDIDC-MESTYP VALUE 'ZORDER'.

    *- Call function module to determine if message is to be distributed

     

    OBJECT_TYPE = 'BUS2012'.

     

      MOVE control_record_in TO control_record_out.

     

      CALL FUNCTION 'ALE_MODEL_DETERMINE_IF_TO_SEND'

        EXPORTING

          MESSAGE_TYPE           = C_MESSAGE_TYPE

        IMPORTING

          IDOC_MUST_BE_SENT      = L_SEND_FLAG.

    •    EXCEPTIONS

    •      OWN_SYSTEM_NOT_DEFINED = 1

    •      OTHERS                 = 2.

     

     

     

     

      DATA : BEGIN OF EKKO_tAB OCCURS 0,

     

      EBELN LIKE EKKO-EBELN,

      F1 TYPE C VALUE ',',

      BUKRS LIKE EKKO-BUKRS,

      F2 TYPE C VALUE ',',

      BSART LIKE EKKO-BSART,

      F3 TYPE C VALUE ',',

      LIFNR LIKE EKKO-LIFNR,

      F4 TYPE C VALUE ',',

      WAERS LIKE EKKO-WAERS,

      F5 TYPE C VALUE ',',

      BEDAT LIKE EKKO-BEDAT,

      F6 TYPE C VALUE ',',

      WERKS LIKE EKPO-WERKS,

      F7 TYPE C VALUE ',',

      PLIFZ LIKE EKPO-PLIFZ,

      F8 TYPE C VALUE ',',

      EBELP LIKE EKPO-EBELP,

      F9 TYPE C VALUE ',',

      MATNR LIKE EKPO-MATNR,

      F10 TYPE C VALUE ',',

      MENGE LIKE EKPO-MENGE,

      F11 TYPE C VALUE ',',

      MEINS LIKE EKPO-MEINS,

      F12 TYPE C VALUE ',',

     

      END OF EKKO_TAB.

      DATA SDATA1 LIKE EKKO_tAB OCCURS 0 WITH HEADER LINE.

      DATA EBELN LIKE EKKO-EBELN.

      WRITE OBJECT-OBJKY TO EBELN.

      SELECT T1EBELN T1BUKRS BSART LIFNR WAERS BEDAT  WERKS PLIFZ EBELP MATNR MENGE MEINS

      FROM EKKO AS T1

      INNER JOIN EKPO AS T2 ON T2EBELN = t1EBELN

      INTO CORRESPONDING FIELDS OF TABLE EKKO_tAB

      WHERE

    *T1~KAPPL = 'EF' AND

      T1~EBELN = EBELN.

    *T1~KSCHL = 'YEDI' .

     

     

     

      DATA SDATA LIKE EDIDD-SDATA.

      DATA NDATE LIKE SY-DATUM.

      DATA NMENGE(17) TYPE C.

     

      LOOP AT EKKO_tAB.

        WRITE EKKO_TAB-MENGE TO NMENGE.

        NDATE = EKKO_tAB-BEDAT + EKKO_tAB-PLIFZ.

        CONCATENATE  EKKO_tAB-EBELP ',' EKKO_tAB-BUKRS ',' EKKO_tAB-BSART EKKO_tAB-EBELN ',' EKKO_tAB-LIFNR ',' EKKO_tAB-BEDAT ','

        NDATE ',' EKKO_tAB-BSART EKKO_tAB-EBELN ',' EKKO_tAB-EBELN ', 0,' EKKO_tAB-MATNR ','

        NMENGE ',' EKKO_tAB-MEINS ',' EKKO_tAB-WERKS INTO SDATA.

        MOVE SDATA TO: W_SDATA, T_EDIDD-SDATA.

        MOVE 'ZORDERS' TO T_EDIDD-SEGNAM.

        APPEND T_EDIDD.

      ENDLOOP.

    *call function 'L_IDOC_SEGMENT_CREATE'

    •     exporting

    •          i_segnam = 'ZORDERS'

    •          i_sdata  = w_sdata

    •     exceptions

    •          others   = 1.

    *LT_EDIDC

    call function 'L_IDOC_SEND'

         tables

              t_comm_idoc           = LT_EDIDC

         exceptions

              error_distribute_idoc = 1

              others                = 2.

    *DATA T_BDI_MODEL LIKE BDI_MODEL.

    • WRITE OBJECT-OBJKY TO T_BDI_MODEL.

     

    • READ TABLE T_BDI_MODEL INDEX 1.      " maximum 1 recipient

    • L_EDIDC-DIRECT = 1.

     

      L_EDIDC-DOCNUM = DOCNUM. "***

     

      L_EDIDC-RCVPRN = 'HCM_00_785'.

      L_EDIDC-RCVPOR = 'MM_PO_FILO'.

      MOVE 'ZORDER'   TO L_EDIDC-MESTYP.

      MOVE 'ZPURIDOC' TO L_EDIDC-IDOCTP.

      MOVE 'LS'      TO L_EDIDC-RCVPRT.

    • MOVE T_BDI_MODEL-RCVSYSTEM TO L_EDIDC-RCVPRN.

     

    *MOVE-CORRESPONDING L_EDIDC TO W_EDIDC.

    *- Distribute the iDoc

    BREAK-POINT.

     

      CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE' "IN UPDATE TASK

        EXPORTING

          MASTER_IDOC_CONTROL            = L_EDIDC

        TABLES

          COMMUNICATION_IDOC_CONTROL     = LT_EDIDC

          MASTER_IDOC_DATA               = T_EDIDD

        EXCEPTIONS

          ERROR_IN_IDOC_CONTROL          = 01

          ERROR_WRITING_IDOC_STATUS      = 02

          ERROR_IN_IDOC_DATA             = 03

          SENDING_LOGICAL_SYSTEM_UNKNOWN = 04.

    IF SY-SUBRC <> 0.

    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

     

    READ TABLE LT_EDIDC INDEX 1.

      control_record_out-direct = '1'.

      CONTROL_RECORD_OUT-DOCNUM = DOCNUM. " ***

      control_record_out-serial = sy-datum.

      control_record_out-serial+8 = sy-uzeit.

      control_record_out-mestyp = LT_EDIDC-mestyp.

      control_record_out-idoctp = LT_EDIDC-idoctp.

     

      control_record_out-SNDPRN = 'HCM_00_786'.

      MOVE 'MM_PO_FILO' TO control_record_out-RCVPOR.

      MOVE 'LI'      TO control_record_out-SNDPRT.

      MOVE 'SAPQIS' TO control_record_out-SNDPOR.

     

     

     

    ENDFUNCTION.

Actions