Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Internal Table

Former Member
0 Likes
517

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
495

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

5 REPLIES 5
Read only

Former Member
0 Likes
495

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

Read only

0 Likes
495

Hi,

Can I have the Query ?

Bye,

satya

Read only

Former Member
0 Likes
495

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

Read only

Former Member
0 Likes
495

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

Read only

Former Member
0 Likes
496

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