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

script

Former Member
0 Likes
675

Hi Friends,

this is my code in a subroutine of my script.

i'm unable to get value into outtab.

This is my code - plz look into this and advice me.

LOOP AT T_VTTP.

  • Select BRGEW from LIPS

SELECT SUM( BRGEW )

INTO L_BRGEW

FROM LIPS

WHERE

VBELN = T_VTTp-VBELN .

IF SY-SUBRC EQ 0.

L_BRGEW_TOT = L_BRGEW_TOT + L_BRGEW.

ENDIF.

read table outtab index sy-tabix.

if outtab-name = c_weight.

outtab-value = L_BRGEW_TOT.

modify outtab index sy-tabix.

endif.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
652

Hello,

Make this change.


data: l_tabix like sy-tabix.  " Check here
LOOP AT T_VTTP.
l_tabix = sy-tabix. " Check here
* Select BRGEW from LIPS
SELECT SUM( BRGEW )
INTO L_BRGEW
FROM LIPS
WHERE
VBELN = T_VTTp-VBELN .

IF SY-SUBRC EQ 0.

L_BRGEW_TOT = L_BRGEW_TOT + L_BRGEW.
read table outtab index l_tabix.  " Check here
if outtab-name = c_weight.
outtab-value = L_BRGEW_TOT.
modify outtab index L_tabix.   " Check here
endif. 
ENDIF.
endlloop. " Check here

If useful reward.

Vasanth

8 REPLIES 8
Read only

Former Member
0 Likes
653

Hello,

Make this change.


data: l_tabix like sy-tabix.  " Check here
LOOP AT T_VTTP.
l_tabix = sy-tabix. " Check here
* Select BRGEW from LIPS
SELECT SUM( BRGEW )
INTO L_BRGEW
FROM LIPS
WHERE
VBELN = T_VTTp-VBELN .

IF SY-SUBRC EQ 0.

L_BRGEW_TOT = L_BRGEW_TOT + L_BRGEW.
read table outtab index l_tabix.  " Check here
if outtab-name = c_weight.
outtab-value = L_BRGEW_TOT.
modify outtab index L_tabix.   " Check here
endif. 
ENDIF.
endlloop. " Check here

If useful reward.

Vasanth

Read only

0 Likes
652

No Vasant, its not working..

I have tried this one.

i'm really surprised - for everything sy-subrc = 0,

but outab-value is not getting populated.

Read only

0 Likes
652

Hello Praveen,

Try like this:


data: l_tabix like sy-tabix.  " Check here
LOOP AT T_VTTP.
l_tabix = sy-tabix. " Check here
* Select BRGEW from LIPS
SELECT SUM( BRGEW )
INTO L_BRGEW
FROM LIPS
WHERE
VBELN = T_VTTp-VBELN .
 
IF SY-SUBRC EQ 0.
 
L_BRGEW_TOT = L_BRGEW_TOT + L_BRGEW.
read table outtab with KEY = 'WEIGHT'.  " Check here
if sy-subrc = 0. " Check here
outtab-value = L_BRGEW_TOT.
modify outtab index L_tabix.   " Check here
endif. 
ENDIF.
endlloop. " Check here

Read only

0 Likes
652

Hi Friends,

This is solved .

i have followed some other logic - define one character variable.

pass the variable to this character field and condense this.

then pass it to outtab-value.

This will solve the problem.

thank you all friends for your valuable time.

Read only

Former Member
0 Likes
652

hai praveen...

can u explain the problem more clearly.....

suresh....

Read only

0 Likes
652

Hi Suresh,

i have outtab with only one parameter weight.

i have written the above code for the subroutine.

of course - everything i', getting right, but i couldn't get the outtab-value populated.

please look into this and help me.

Thanks

Read only

Former Member
0 Likes
652

Hi praveen,

i do it in this way:

READ TABLE OUT_TAB WITH KEY = 'ZEIVR'. "Variable which i will update

OUT_TAB-VALUE = MARA-ZEIVR.

MODIFY OUT_TAB INDEX SY-TABIX.

in your example:

read table outtab with key c_weight.

outtab-value = L_BRGEW_TOT.

modify outtab index sy-tabix.

Regards, Dieter

Read only

Former Member
0 Likes
652

Thanks