cancel
Showing results for 
Search instead for 
Did you mean: 

Subroutine in Scripts

Former Member
0 Kudos

Hi,

i wrote Perform......endperform in Script and kept break-point in Program. after activating debugger in Script,the cursor is coming to the Perform statement but its not entering into the Program in which break-point is there.Please refer to my coding in Script and in Program and help me solving the issue.

In Script

/:PERFORM WHDTAX IN PROGRAM ZWHDTAX

/:USING &REGUP-VBLNR&

/:USING &REGUP-ZJAHR&

/:CHANGING &SGTXT&

/:ENDPERFORM

Program name : ZWHDTAX

Type: subroutine pool

&----


*& Subroutine Pool ZWHDTAX

*&

&----


*&

*&

&----


PROGRAM ZWHDTAX.

FORM WHDTAX tables in_tab structure itcsy

out_tab structure itcsy.

Tables: REGUP, BSAK.

DATA : A_VBLNR TYPE REGUP-VBLNR,

A_GJAHR TYPE REGUP-GJAHR,

V_SGTXT TYPE REGUP-SGTXT.

read table in_tab WITH KEY NAME = 'REGUP-VBLNR'.

check sy-subrc = 0.

a_vblnr = in_tab-value.

read table in_tab WITH KEY NAME = 'REGUP-GJAHR'.

check sy-subrc = 0.

a_GJAHR = in_tab-value.

BREAK-POINT.

SELECT SINGLE SGTXT FROM BSAK INTO V_SGTXT WHERE AUGBL = A_VBLNR

AND GJAHR = A_GJAHR.

READ TABLE OUT_TAB WITH KEY NAME = 'SGTXT'.

CHECK SY-SUBRC = 0.

OUT_TAB-VALUE = V_SGTXT.

MODIFY OUT_TAB INDEX SY-TABIX.

CLEAR V_SGTXT.

ENDFORM.

************************************************************************

Thanks

K Srinivas

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

Try writing it this way in the script.

/:PERFORM WHDTAX IN PROGRAM 'ZWHDTAX'

/:USING &REGUP-VBLNR&

/:USING &REGUP-ZJAHR&

/:CHANGING &SGTXT&

/:ENDPERFORM

Let me know how it does...

Nayan

Answers (5)

Answers (5)

Former Member
0 Kudos

answered

Former Member
0 Kudos

Hi,

Please check whether you have activated the program.

Also check whether you are reading the correct key from table in_tab i.e. check if REGUP-VBLNR is correct.

Also try using read statement as below:

read table in_tab WITH KEY 'REGUP-VBLNR'.

regards,

Gaurav

former_member181995
Active Contributor
0 Kudos

What shortcuts you are using? use F5 not F6 while your curson reaches at perform.

Former Member
0 Kudos

Im using F5 only

Thanks

K Srinivas

narin_nandivada3
Active Contributor
0 Kudos

Hi Srinivas,

The place you kept the break-point reaches if and only if the DATA is read from the table in_tab.

You place the break-point above the CHECK SY_SUBRC EQ 0 statement like shown below. That would help you.


PROGRAM ZWHDTAX.
FORM WHDTAX tables in_tab structure itcsy
out_tab structure itcsy.

Tables: REGUP, BSAK.

DATA : A_VBLNR TYPE REGUP-VBLNR,
A_GJAHR TYPE REGUP-GJAHR,
V_SGTXT TYPE REGUP-SGTXT.

BREAK-POINT.  " specify it here... 

read table in_tab WITH KEY NAME = 'REGUP-VBLNR'.
check sy-subrc = 0.
a_vblnr = in_tab-value.

read table in_tab WITH KEY NAME = 'REGUP-GJAHR'.
check sy-subrc = 0.
a_GJAHR = in_tab-value.

- Narin

Former Member
0 Kudos

Im getting the final value as '2007' in REGUP-GJAHR field even though i gave the input for Fiscal Year as '2008' in FBZ5 tcode.How to get the given value.Please help.

Mohamed_Mukhtar
Active Contributor
0 Kudos

hi Srinivas,

Your code looks perfect...

Why dont u hard code the BREAK-POINT.

With Regards,

Always Learner

Former Member
0 Kudos

i kept the BREAK-POINT above ' Select ' Statement.

Thanks

K Srinivas