Skip to Content
Former Member
May 13, 2011 at 07:36 AM

procees for upload field in mkpf&mseg table


Hi friends,

i had return the code for uploading two fields in mkpf and mseg table .when i am executing through f8 the updated value is not founding when we checkd through debugging the value is updating and appering in screen plz tell me how i will solve the issue.

for u r referenece i am sending the code what i had return in logic.

types: BEGIN OF it_tab,
        prueflos(16) type c,
        MBLNR type mblnr,
        TYP type QAMBTYPE,
        END OF it_tab.
      types: begin of it_tab1.
       include type mkpf.
      types: END OF it_tab1.
      types:begin of it_mseg.
      include type mseg.
      types:end of it_mseg.
*        end of it_tab1.
     types: ts_tab1 type STANDARD TABLE OF it_tab1.
     types: ts_mseg type STANDARD TABLE OF it_mseg.
     data: ts_tab type STANDARD TABLE OF it_tab,
           wa_tab type it_tab,
           wa_tab1 type it_tab1,
           ts_tab2 type ts_tab1,
           ts_mseg type ts_mseg,
           wa_mseg type it_mseg,
           it_tab12 type  it_tab1 OCCURS 0 WITH HEADER LINE.
       select PRUEFLOS mblnr typ from QAMB
         into table ts_tab  where prueflos = it_final-prueflos
                              and    typ = '3'.
         if ts_tab[] is not INITIAL.
           sort ts_tab[] by mblnr.
          select * from mkpf into TABLE ts_tab2 FOR ALL ENTRIES IN ts_tab where mblnr =  ts_tab-mblnr.
            if ts_tab2[] is not INITIAL.
              sort ts_tab2[] by mblnr.
              select * from mseg into table ts_mseg FOR ALL ENTRIES IN ts_tab2 where mblnr = ts_tab2-mblnr.
         loop at ts_tab into wa_tab .
           READ TABLE ts_tab2 into wa_tab1 with key mblnr = wa_tab-mblnr.
           wa_tab1-FRBNR = it_data1-FRBNR.
           if sy-subrc eq 0.
            wait UP TO 2 SECONDS.
          update mkpf from wa_tab1.
          COMMIT WORK .
           read table ts_mseg into wa_mseg with key mblnr = wa_tab1-mblnr.
           wa_mseg-sgtxt = it_data1-trucknum.
           if sy-subrc eq 0.
             wait UP TO 2 seconds.
          update mseg from wa_mseg.
          COMMIT WORK .

thanks in advance,


Edited by: Thomas Zloch on May 13, 2011 1:37 PM - please use code tags