‎2007 Mar 16 2:20 AM
Hi All,
We have defined Perform statement in sap script as follows.
DEFINE &V_VBLNR& = ®UH-VBLNR&
DEFINE &V_GJAHR& = ®UH-ZALDT&
DEFINE &V_ZBUKR& = ®UH-ZBUKR&
DEFINE &V_CHECT& = *
PERFORM F_GET_CHEQUE IN PROGRAM ZFFIAP_PMNT_RMTT
USING &V_VBLNR&
USING &V_GJAHR&
USING &V_ZBUKR&
CHANGING &V_CHECT&
ENDPERFORM
In the program (se38), we have the subroutines defined as follows.
FORM F_GET_CHEQUE TABLES input_table STRUCTURE itcsy
output_table STRUCTURE itcsy.
TABLES PAYR.
tables REGUH.
Clear PAYR.
DATA V_VBLNR(10) TYPE C.
DATA V_GJAHR(10) TYPE C.
data V_ZBUKR(10) TYPE C.
data v_gjahr_year(4) type c.
READ TABLE input_table WITH KEY name = 'V_VBLNR'.
IF sy-subrc NE 0.
EXIT.
ELSE.
V_VBLNR = input_table-value.
ENDIF.
READ TABLE input_table WITH KEY name = 'V_GJAHR'.
IF sy-subrc NE 0.
EXIT.
ELSE.
V_GJAHR = input_table-value.
ENDIF.
move v_gjahr+0(4) to v_gjahr_year.
READ TABLE input_table WITH KEY name = 'V_ZBUKR'.
IF sy-subrc NE 0.
EXIT.
ELSE.
V_ZBUKR = input_table-value.
ENDIF.
select single * from PAYR where vblnr = V_VBLNR
and gjahr = v_gjahr_year and zbukr = V_ZBUKR.
IF sy-subrc = 0.
output_table-value = PAYR-CHECT.
ELSE.
output_table-value = ' '.
ENDIF.
MODIFY output_table
TRANSPORTING value WHERE name = 'V_CHECT'.
ENDFORM. "F_GET_CHEQUE
Now still the code is unable to retrieve the Cheque Number with the above code.
What might be the reason..????
Basically when user enters the data in F110 screen and clicks Print icon, the sap script and program will run in background mode.. Then remittance order will get printed.
Even i am unable to debug it due to it's background mechanism....
Please Help me.....
Regards
Pavan
‎2007 Mar 16 3:52 AM
hi
good
if it is running in the background than i would suggest you to check wheather the data is passing from driver program to your persorm statement,i think you can debug the driver prograam using \h command.
thanks
mrtyun^
‎2007 Mar 16 3:43 AM
in your program for reading the table use
READ TABLE input_table WITH KEY 'V_GJAHR'.
checck sy-subrc = 0.
V_GJAHR = input_table-value.
for out_table
READ TABLE input_table WITH KEY 'V_CHECT'.
checck sy-subrc = 0.
output_table-value = PAYR-CHECT.
MODIFY output_table index sy-tabix.
regards
shiba dutta
‎2007 Mar 16 3:51 AM
Hi Pavan,
Good morning.
First of all check in the table whether data exist or not with that where condition. If no data then no cheque number will be diplayed, right? so check the data in table. Even the script was running in back ground job we can debug the script. it is possible. First activate debugger from the script level. after that set the breakpointin the program. Run F110 and enter required input values. Then execute properly. Then script will enter in to debugmode. Hope this helps you. Reply for queries.
Regards,
Kumar.
‎2007 Mar 16 3:52 AM
hi
good
if it is running in the background than i would suggest you to check wheather the data is passing from driver program to your persorm statement,i think you can debug the driver prograam using \h command.
thanks
mrtyun^