cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with KOMFKGN

Former Member
0 Kudos

Hello,

I extends the structure  KOMFKGN of the new field ZZVALUE01 and I would put the value in the table VBRP. I have append structure in Table VBRP.

The value is inbound in e1wxx01 segment of WPUUMS idoc.

I found information that I should use IF_BADI_WPOS_WPUUMS~CHANGE_APPLICATION_DOCUMENTS. I write this:

     FIELD-SYMBOLS: <fs_komfkgn> TYPE komfkgn.

   FIELD-SYMBOLS: <fs_e1wxx01> TYPE e1wxx01.

   FIELD-SYMBOLS: <fs_edidd>   TYPE edidd.

    

     LOOP AT cs_application_data-idoc_segs-edidd ASSIGNING <fs_edidd> WHERE segnam = 'E1WXX01'.

      ASSIGN <fs_edidd>-SDATA to <fs_e1wxx01> CASTING.

      if <fs_e1wxx01>-FLDNAME = 'DWSPRZZAK'.

          loop at cs_application_data-dc_komfkgn ASSIGNING <fs_komfkgn>.

              IF sy-subrc = 0.

               lv_fldval = <fs_e1wxx01>-fldval.

              <fs_komfkgn>-zzvalue01 = lv_fldval.

              ENDIF.

              endloop.

But after this the field in table in empty. Do I need to additionally change somewhere in SAP configuration ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Do like below. it will work.

* Move the values in the segment 'E1WPU02' into a table

LOOP AT io_interface-idoc_segs-edidd INTO ls_edidd WHERE segnam = 'E1WPU02'.

   APPEND ls_edidd TO lt_edidd_e1wpu02.

   CLEAR ls_edidd.

ENDLOOP.

* Move the values in the segment 'E1WXX01' into a table

LOOP AT io_interface-idoc_segs-edidd INTO ls_edidd WHERE segnam = 'E1WXX01'.

   APPEND ls_edidd TO lt_edidd_e1wxx01.

   CLEAR ls_edidd.

ENDLOOP.

* Check if the user segment E1WXX01 table contains suitable values.

LOOP AT lt_edidd_e1wxx01 INTO ls_edidd.

   IF ls_edidd-sdata+0(5)  = '1123' AND

      ls_edidd-sdata+5(5)  = 'TEST' AND

      ls_edidd-sdata+15(3) = '150'.

     READ TABLE lt_edidd_e1wpu02 WITH KEY segnum = ls_edidd-psgnum INTO ls_edidd_bill.

     IF sy-subrc = 0.

       READ TABLE io_interface-dc_komfkgn INDEX sy-tabix INTO ls_komfkgn.

       IF sy-subrc = 0.

* Modify the inv line item with the order reason

         ls_komfkgn-augru = '150'.

         MODIFY io_interface-dc_komfkgn FROM ls_komfkgn INDEX sy-tabix.

         CLEAR ls_komfkgn.

       ENDIF.

     ENDIF.

ENDLOOP.

Former Member
0 Kudos

Thank you for your answer. Now it is working. I thought about it for a whole week and today I found the answer. I found a enhancement RV60AFZC which clear structure komfkgn and mapping values in the code.

Answers (0)