‎2007 Jun 27 7:59 AM
Hi,
I have two Internal Tables IT_MSEG and IT_MKPF.
IT_MKPF Contains BUDAT Posting date for every record but it_mseg does not contai.
So, My problem is I have to add this BUDAT into IT_MSEG for every record by comparing MBLNR .
How can we do it ?
can we do it by a single modify statement or not ?
Bye,
Satya
‎2007 Jun 27 8:07 AM
HI.
Refer this code.
LOOP AT IT_EKPO.
MOVE-CORRESPONDING IT_EKPO TO IT_MERGE.
APPEND IT_MERGE.
ENDLOOP.
LOOP AT IT_MERGE .
READ TABLE IT_EKKO WITH KEY EBELN = IT_MERGE-EBELN BINARY SEARCH.
IF SY-SUBRC = 0.
MOVE-CORRESPONDING IT_EKKO TO IT_MERGE.
MODIFY IT_MERGE.
ENDIF.
ENDLOOP.
Reward all helpfull answers.
Regards.
Jay
‎2007 Jun 27 8:01 AM
Hi
Fetch the data from MKPF and MSEG into a Single internal table with the required fields by jopining them with MBLNR field
then try to change the field BUDAT in that ITAB
Reward points for useful Answers
Regards
Anji
‎2007 Jun 27 8:18 AM
‎2007 Jun 27 8:04 AM
Yes this can be done.
first of all u ned to add the field in the structure of it_mseg.
then use the following code.
loop at it_mkpf.
read table it_mseg with key mblnr = it_mkpf-mblnr.
if sy-subrc 0.
it_mseg-mblnr = it_mkpf-mblnr.
modify it_mseg.
endif.
clear it_mseg.
clear it_mkpf.
endloop.
Reward if useful.
Regards abhi
‎2007 Jun 27 8:05 AM
Yes this can be done.
first of all u ned to add the field in the structure of it_mseg.
then use the following code.
loop at it_mkpf.
read table it_mseg with key mblnr = it_mkpf-mblnr.
if sy-subrc 0.
it_mseg-budat = it_mkpf-budat.
modify it_mseg.
endif.
clear it_mseg.
clear it_mkpf.
endloop.
Reward if useful.
Regards abhi
‎2007 Jun 27 8:07 AM
HI.
Refer this code.
LOOP AT IT_EKPO.
MOVE-CORRESPONDING IT_EKPO TO IT_MERGE.
APPEND IT_MERGE.
ENDLOOP.
LOOP AT IT_MERGE .
READ TABLE IT_EKKO WITH KEY EBELN = IT_MERGE-EBELN BINARY SEARCH.
IF SY-SUBRC = 0.
MOVE-CORRESPONDING IT_EKKO TO IT_MERGE.
MODIFY IT_MERGE.
ENDIF.
ENDLOOP.
Reward all helpfull answers.
Regards.
Jay