‎2005 Jul 06 12:40 PM
Hi ,
I am facing some problem in calling a subroutine from Standard Text element (Txn SO10).
I have done the following in a text element.
/: DEFINE &GD_PREV_NAME& = ''
/: PERFORM GET_PREV_NAME IN PROGRAM ZTEST
/: USING &P0001-PERNR&
/: USING &P0002-BEGDA&
/: CHANGING &GD_PREV_NAME&
/: ENDPERFORM
In the ABAP ZTEST,
FORM get_prev_name TABLES tabin STRUCTURE itcsy
tabout STRUCTURE itcsy.
DATA : ld_pernr LIKE pa0001-pernr.
READ TABLE tabin WITH KEY name = 'P0001-PERNR'.
IF sy-subrc = 0.
ld_pernr = tabin-value.
ENDIF.
........................
ENDFORM.
I found in debugging that the both tables TABIN & TABOUT are empty in the FORM get_prev_name !!!!
Can anyone hint on why the values are not passed to ABAP ??
Many thanks in advance.
Regards,
Sandip.
Ph : +44 121 683 2814.
‎2005 Jul 06 12:48 PM
Hi ,
Just change tour code in the ABAP program like this.
FORM get_prev_name TABLES tabin STRUCTURE itcsy
tabout STRUCTURE itcsy.
DATA : ld_pernr LIKE pa0001-pernr.
READ TABLE tabin index 1.
IF sy-subrc = 0.
ld_pernr = tabin-value.
ENDIF.
ENDFORM.
Cheers,
Sam.
‎2005 Jul 06 1:06 PM
Sam,
I would like to inform that the table TABIN has got no values at all.TABIN[] is EMPTY.
So it does not matter whether you read it by INDEX 1 or by WITH KEY......
Please suggest.
Thanks,Sandip.
‎2005 Jul 06 1:06 PM
Hi Sandip,
How did you check that tables are empty ?
Regards,
Sanjeev
‎2005 Jul 06 1:20 PM
Hi ,
In debigging I see tables are empty.
But the same text element is printing the P0001-PERNR and P0002-BEGDA correctly !
So I am just confused as why it is not passed to the ABAP Subroutine I am calling.
Help buddies with your views.I am ready for any hit-n-trial.
Thank you very much.
Sandip.
‎2005 Jul 06 1:26 PM
HI gotit!!!!
without the &s
Just try this.
/: DEFINE &GD_PREV_NAME& = ''
/: PERFORM GET_PREV_NAME IN PROGRAM ZTEST
/: USING P0001-PERNR
/: USING P0002-BEGDA
/: CHANGING &GD_PREV_NAME&
/: ENDPERFORM
Cheers,
Sam.
‎2005 Jul 06 1:12 PM
Hi Sandip,
I guess the problem here might be that the values aren't getting flown.
First try this (hardcoding and testing),
/: DEFINE &GD_PREV_NAME& = ''
/: PERFORM GET_PREV_NAME IN PROGRAM ZTEST
/: USING '1000'
/: USING '20050101'
/: CHANGING &GD_PREV_NAME&
/: ENDPERFORM
if it works fine, then figure out whether the variables P0001-PERNR AND P0002-BEGDA are not null when passed. If not then try this
/: DEFINE &GD_PREV_NAME& = ''
/: PERFORM GET_PREV_NAME IN PROGRAM ZTEST
/: USING &P0000-PERNR&
/: USING &P0002-BEGDA&
/: CHANGING &GD_PREV_NAME&
/: ENDPERFORM
ELSE TRY PA0000-PERNR AND PA0002-BEGDA
Cheers,
Sam.