2015 Apr 17 5:00 AM
Hi, Expert
Kindly need your help regarding passing parameter from SAPscript,
I have write a command below in SAPscript:
DEFINE : &LV_ACNO& = ''
DEFINE : &LV_BVTYP& = ''
PERFORM GET_ACCOUNT IN PROGRAM ZFIF_CHEQUEPRINT
USING ®UH-LIFNR&
USING ®UH-BVTYP&
CHANGING &LV_ACNO&
ENDPERFORM
in FORM:
FORM get_account TABLES intab STRUCTURE itcsy
outtab STRUCTURE itcsy.
DATA: p_input1 TYPE tdsymvalue,
p_input2 TYPE tdsymvalue.
READ TABLE intab INDEX 1.
IF sy-subrc = 0.
MOVE intab-value TO p_input1.
ENDIF.
But, when i try to debug, there's got only one field in the INTAB as below, while, REGUH-BVTYP is missing.
Thought that, it will work based on looking around the forums - but it seems I am missing something.
Please help and guide.
Thanks in advance,
Regards,
Liyana.
2015 Apr 21 4:52 AM
Hi All,
when try to debug sapscript, found as below screenshot, why USING ®UH-BVTYP& is missing there? i already activate the sapscript.
Please advise.
Thanks and regards,
Liyana
Hi, Expert
Kindly need your help regarding passing parameter from SAPscript,
I have write a command below in SAPscript:
DEFINE : &LV_ACNO& = ''
DEFINE : &LV_BVTYP& = ''
PERFORM GET_ACCOUNT IN PROGRAM ZFIF_CHEQUEPRINT
USING ®UH-LIFNR&
USING ®UH-BVTYP&
CHANGING &LV_ACNO&
ENDPERFORM
in FORM:
FORM get_account TABLES intab STRUCTURE itcsy
outtab STRUCTURE itcsy.
DATA: p_input1 TYPE tdsymvalue,
p_input2 TYPE tdsymvalue.
READ TABLE intab INDEX 1.
IF sy-subrc = 0.
MOVE intab-value TO p_input1.
ENDIF.
But, when i try to debug, there's got only one field in the INTAB as below, while, REGUH-BVTYP is missing.
Thought that, it will work based on looking around the forums - but it seems I am missing something.
Please help and guide.
Thanks in advance,
Regards,
Liyana.
2015 Apr 17 6:25 AM
Hi ,
Try.
/: PERFORM GET_ACCOUNT IN PROGRAM 'ZFIF_CHEQUEPRINT'
/: USING ®UH-LIFNR&
/: USING ®UH-BVTYP&
/: CHANGING &LV_ACNO&
/: ENDPERFORM
FORM GET_ACCOUNT TABLES intab STRUCTURE itcsy
out_tab STRUCTURE itcsy. "#EC *
READ TABLE intab WITH KEY name = 'REGUH-LIFNR'.
IF SY-SUBRC IS INITIAL.
V_vendor = IN_TAB-VALUE.
ENDIF.
READ TABLE OUT_TAB WITH KEY NAME = 'LV_ACNO'.
IF SY-SUBRC IS INITIAL.
OUT_TAB-VALUE = V_TXT50.
MODIFY OUT_TAB INDEX SY-TABIX.
Hope it helpful,
Regards,
Venkat
2015 Apr 20 8:45 AM
Thank you for your response,
just know i got problem to pass the parameter REGUH-BVTYP to the subroutine
I'm not so sure if there is something missing since i already follow the steps.
Please advise.
Thanks and Regards,
Liyana
2015 Apr 20 9:19 AM
Hi Liyana,
Have you activated your sap script. Please activate your sap script and start debugging.
Thanks
2015 Apr 20 9:29 AM
2015 Apr 20 9:39 AM
HI Liyana,
Share the screen shot of 'perform' from SAP script and also subroutine pool.
Thanks
2015 Apr 20 10:07 AM
Hi always,
below attached the screen shot of 'perform' from SAP script and also subroutine pool
FORM get_account TABLES intab STRUCTURE itcsy
outtab STRUCTURE itcsy.
TYPES:
BEGIN OF lty_lfbk,
bankl LIKE lfbk-bankl,
bankn LIKE lfbk-bankn,
END OF lty_lfbk.
DATA: lt_lfbk TYPE STANDARD TABLE OF lty_lfbk WITH HEADER LINE,
lw_lfbk TYPE lty_lfbk.
DATA: p_input1 TYPE tdsymvalue,
p_input2 TYPE tdsymvalue,
lv_output1 TYPE tdsymvalue,
lv_acno(65) TYPE c.
READ TABLE intab INDEX 1.
IF sy-subrc = 0.
MOVE intab-value TO p_input1.
ENDIF.
READ TABLE intab INDEX 2.
IF sy-subrc = 0.
MOVE intab-value TO p_input2.
ENDIF.
IF p_input2 IS INITIAL.
CLEAR lt_lfbk.
SELECT bankl bankn
INTO TABLE lt_lfbk
FROM lfbk
WHERE lifnr = p_input1
ORDER BY bankn DESCENDING.
READ TABLE lt_lfbk INTO lw_lfbk INDEX 1.
IF sy-subrc = 0.
MOVE: lw_lfbk-bankl TO lv_bankl,
lw_lfbk-bankn TO lv_bankn.
ENDIF.
ELSE.
CLEAR lt_lfbk.
SELECT bankl bankn
INTO TABLE lt_lfbk
FROM lfbk
WHERE lifnr = p_input1
AND bvtyp = p_input2.
ENDIF.
READ TABLE outtab INDEX 1.
IF sy-subrc = 0.
outtab-value = lv_output1.
MODIFY outtab INDEX 1 .
ENDIF.
ENDFORM.
2015 Apr 20 10:32 AM
Hi,
in Formroutine GET_ACCOUNT you have Tables parameter. But in SAP-Script you give Using parameter. That can not fit.
as far as i know. Wahtever variable you want in SAP_SCRIPT has to be defined as global variable in the calling programm. when you want to do some complex work on the data, you can do this in a form routine defined somewhere in a programm. (in your case u defined the formroutine in programm ZFIF_CHEQUEPRINT). But actually it doesnt matter where its defined since you give all parameters as table, using and changing and exporting.
-> in your script coding look that the variables from your calling programm (sourroundes by &) are defined in your main programm.
-> give the subroutine GET_ACCOUNT some valid variables. if you want it to have a table-parameter, get a table parameter in your main programm too.
regards
Stefan Seeburger
2015 Apr 21 4:52 AM
Hi All,
when try to debug sapscript, found as below screenshot, why USING ®UH-BVTYP& is missing there? i already activate the sapscript.
Please advise.
Thanks and regards,
Liyana
2015 Apr 21 5:00 AM
Hi,
Please do a syntax check and then activate your form and this form is being called in EN.
Kindly check in which language you have implemented the change is sap script and also implement the change in EN language.
To know in how many language the form is available, please follow below path :-
Menu->Utilities->version
Thanks
2015 Apr 21 5:48 AM
Just a stab in the dark:
Sapscript is client-dependent, therefore if you're testing in a different client than the one you made your changes in it may be necessary to copy the changes to the testing client using transaction SCC1.
2015 Apr 21 6:06 AM
adding to Esti van Wyk,
Script is language dependent also.. please check in which language you are making changes..
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |