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

PERFORM statement in SAP script

Former Member
0 Likes
1,135

Hi All,

We have defined Perform statement in sap script as follows.

DEFINE &V_VBLNR& = &REGUH-VBLNR&

DEFINE &V_GJAHR& = &REGUH-ZALDT&

DEFINE &V_ZBUKR& = &REGUH-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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
537

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^

3 REPLIES 3
Read only

Former Member
0 Likes
537

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

Read only

Former Member
0 Likes
537

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.

Read only

Former Member
0 Likes
538

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^