‎2006 Sep 04 9:48 AM
HEY HI ALL,
I HAVE A TRIAL CODE BUT I AM NOT ABLE TO PASS THE VALUE OF MY VARIABLE PLZ CHK:
CODES:
/: pERFORM GET_DATA IN PROGRAM ZF_D_INT_SCALE_1
/: USING &ZIS_FORM-HKONT&
/: CHANGING &VARIABLE&
/: ENDPERFORM
/P &VARIABLE&
***************************************
REPORT ZF_D_INT_SCALE_1 .
FORM GET_DATA TABLES in_par STRUCTURE ITCSY
out_par STRUCTURE ITCSY.
out_par-value = 333333.
MODIFY out_par TRANSPORTING VALUE .
endform.
******************************************
THANKS TO ALL IN ADVANCE !!!
‎2006 Sep 04 9:53 AM
Hi,
In the code you have used this statement.
MODIFY out_par TRANSPORTING VALUE .
Use the INDEX addtion instead of TRANSPORTING.
change the above statement like
MODIFY out_par index sy-tabix.
‎2006 Sep 04 9:59 AM
hi,
give like this..
data: var1 like...
read table in_tab with key name = 'VAR1'.
if sy-subrc = 0.
move in_tab-value to var1.
endif.
read table out_tab with key name = 'VAR_OUT'.
if sy-subrc = 0.
move 333333 to out_tab-value.
modify out_tab index sy-tabix.
endif.
hope this helps,
do reward if it helps,
priya.
‎2006 Sep 04 10:07 AM
Hi Anupama,
I think all of your code is ok , you need to only add the index sy-tabix to your modify statement while passing the value to the output table.
Regards.
Sunmit.
Please reward points if helpful.
‎2006 Sep 04 10:18 AM
Hi Anupma,
Please change ur code as per below:
CODES:
/: pERFORM GET_DATA IN PROGRAM ZF_D_INT_SCALE_1
/: USING &ZIS_FORM-HKONT&
/: CHANGING &VARIABLE&
/: ENDPERFORM
/P &VARIABLE&
***************************************
REPORT ZF_D_INT_SCALE_1.
FORM GET_DATA TABLES in_par STRUCTURE ITCSY
out_par STRUCTURE ITCSY.
READ TABLE in_par WITH KEY 'ZIS_FORM-HKONT'.
IF SY-SUBRC = 0.
Do your further coding here.
READ TABLE out_par WITH KEY 'VARIABLE'.
IF SY-SUBRC = 0.
out_par-value = 333333.
MODIFY out_par INDEX sy-tabix.
ENDIF.
ENDIF.
endform.
******************************************
Hope it helps.
Cheers,
Patrick
‎2006 Sep 04 10:58 AM
MODIFY out_par TRANSPORTING VALUE <b>where name = 'VARIABLE'</b>. "This the name of the variable you want to modify its value.
name should be in where condition is required.
else use SY-tabix = 1.
MODIFY out_par TRANSPORTING VALUE <b>INDEX 1</b>.
and one more suggestion,
as the VALUES are treated as character , you use
OTAB-VALUE = '333333'.
Regards
srikanth
Message was edited by: Srikanth Kidambi