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

Urgent Help

Former Member
0 Likes
884

Hi everyone,

Im have 2 internal tables.

say ITAB and JTAB

In ITAB In JTAB

say <b>hr pln</b> say <b> hr qty</b>

1-2 20 1-2 5

2-3 30 2-3 10

3-4 40 3-4 20

4-5 60

5-6 90

Now my requirment is i want to move JTAB-qty to

ITAB with respect to ITAB-hr.

Plz send me the logic.

Its vry urgent.

thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
861

Try this,

LOOP AT ITAB.

READ TABLE JTAB WITH KEY HR = ITAB-HR.

IF SY-SUBRC EQ 0.

ITAB-QTY = JTAB-QTY.

MODIFY ITAB TRANSPORTING QTY.

ENDIF.

ENDLOOP.

or this,

FIELD-SYMBOLS: <FS_ITAB> LIKE LINE OF ITAB.

LOOP AT ITAB ASSIGNING <FS_ITAB>.

READ TABLE JTAB WITH KEY HR = <FS_ITAB>-HR.

CHECK SY-SUBRC EQ 0.

<FS_ITAB>-QTY = JTAB-QTY.

ENDLOOP.

Regards

Kathirvel

Hi everyone,

Im have 2 internal tables.

say ITAB and JTAB

In ITAB In JTAB

say <b>hr pln</b> say <b> hr qty</b>

1-2 20 1-2 5

2-3 30 2-3 10

3-4 40 3-4 20

4-5 60

5-6 90

Now my requirment is i want to move JTAB-qty to

ITAB with respect to ITAB-hr.

Plz send me the logic.

Its vry urgent.

thanks in advance.

5 REPLIES 5
Read only

Former Member
0 Likes
862

Try this,

LOOP AT ITAB.

READ TABLE JTAB WITH KEY HR = ITAB-HR.

IF SY-SUBRC EQ 0.

ITAB-QTY = JTAB-QTY.

MODIFY ITAB TRANSPORTING QTY.

ENDIF.

ENDLOOP.

or this,

FIELD-SYMBOLS: <FS_ITAB> LIKE LINE OF ITAB.

LOOP AT ITAB ASSIGNING <FS_ITAB>.

READ TABLE JTAB WITH KEY HR = <FS_ITAB>-HR.

CHECK SY-SUBRC EQ 0.

<FS_ITAB>-QTY = JTAB-QTY.

ENDLOOP.

Regards

Kathirvel

Read only

0 Likes
861

Hi ur first ans solved the problem.

Thanks for ur help.

Read only

0 Likes
861

hi ,

if kathirvel solved ur problem, pls mark him 10 points.

rgds

Anver

Read only

anversha_s
Active Contributor
0 Likes
861

hi,

chk this.

loop at itab.
read table jtab with key hr = itab-hr transporting qty.
if sy-subrc = 0.
itab-qty = jtab-qty.
modify itab transporting qty.
endif.
endloop.

Regards

Anver

Read only

Former Member
0 Likes
861

Hi Stanley

Hope your problem is solved, kinldy close the thread. If the posts are helpful please reward points which were helpful to you.

Regards

Kathirvel