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

check printing....SAP Scripts

Former Member
0 Likes
1,584

/: DEFINE &MYSYMBOL& = &REGUH-VBLNR&

/: DEFINE &OUTSYMBOL& = &OUTSYMBOL&

AS &MYSYMBOL&

/: PERFORM EXTRACT IN PROGRAM ZSUBROUTINE1

/: USING &MYSYMBOL&

/: USING &OUTSYMBOL&

/: ENDPERFORM.

AS &OUTSYMBOL&

FORM EXTRACT TABLES IN_PAR STRUCTURE ITCSY OUT_PAR STRUCTURE ITCSY.

TABLES : REGUP.

DATA : BILL_NO LIKE ITCSY-VALUE.

DATA : ITAB LIKE REGUP OCCURS 0 WITH HEADER LINE.

DATA : WRBTR1(13) TYPE C.

READ TABLE IN_PAR WITH KEY NAME = 'MYSYMBOL'.

IF SY-SUBRC = 0.

BILL_NO = IN_PAR-VALUE.

ENDIF.

SELECT * FROM REGUP INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE

VBLNR = BILL_NO.

LOOP AT ITAB.

READ TABLE ITAB INDEX SY-TABIX..

IF SY-SUBRC = 0.

MOVE ITAB-WRBTR TO WRBTR1.

MOVE WRBTR1 TO OUT_PAR-VALUE.

MODIFY OUT_PAR INDEX SY-TABIX.

ENDIF.

ENDLOOP.

ENDFORM.

This is what i am using but i cannot see any output on the layout, I suppose the subroutine call is not working.

Could anyone please help me out..

Mave

17 REPLIES 17
Read only

Vinod_Chandran
Active Contributor
0 Likes
1,447

Hi,

Please check the following.

1. Is your window (where the subroutine is called) is getting called from the print program?

2. Put a break point in the subroutine and execute the print program

3. If the above does not work, activate the SAPScript debugger and check what is happening.

Thanks

Vinod

Read only

Former Member
0 Likes
1,447

Hi,

/: DEFINE &MYSYMBOL& = &REGUH-VBLNR&

/: DEFINE &OUTSYMBOL& = &OUTSYMBOL&

AS &MYSYMBOL&

/: PERFORM EXTRACT IN PROGRAM ZSUBROUTINE1

/: USING &MYSYMBOL&

/: <b>CHANGING</b> &OUTSYMBOL&

/: ENDPERFORM.

AS &OUTSYMBOL&

use CHANGING instead of USING...

hope this works..

Regards,

Pradhiba

Read only

0 Likes
1,447

Just set a breakpoint in the perform. You can check if the values are passed correctly. You might want to try yo pass a static value back to the script first in order to test your code.

Read only

0 Likes
1,447

Hello,

Try putting quotes

DEFINE &MYSYMBOL& = '&REGUH-VBLNR&'

Activate the debugger and see if values are getting passed.

Regards,

Shekhar Kulkarni

Read only

Former Member
0 Likes
1,447

See i have used the SAP debugger and the printing program is RFFOUS_C and the subroutine is Zsubroutine1 ,i want to debug the subroutine can you please advise how could that is possible.

I can debug the sapscript but not the subroutine used behind.

Read only

0 Likes
1,447

Hi Mave,

Please follow these steps.

I would suggest to put a break point in the subroutine initially before debug the SAPScript. Code 'break-point' or 'break <userid>' just after the FORM statement. Now execute your transaction which calls the SAPScript. So if your subroutine is called, it will stop there.

If this is not working, go ahead with the SAPScript debugging. For this go to SE71 transaction and take the menu Utilities -> Activate Debugger. After this execute your transaction. Now you will get a popup 'SAPScript Form Debugger'. Press the OK button. SAPScript debugging is similar to normal debugging. You can use the 'Single Step' button to execute each line.

Thanks

Vinod

Read only

0 Likes
1,447

In SE38 open the program ZSUBROUTINE1 and keep a breakpoint in the corresponding perform loop... in this way you can find out what is being passed to the sapscript..

Regards,

Pradhiba

Read only

0 Likes
1,447

Hi Pradhiba,

Obivously i had set breakpoints in Zsubroutine1 program earlier only, when i am running the transaction FBZ5 for check printing after activating the SAPscript dewbugger.

I am routed to SAPscript debugger i cannot go to the subroutine .

Please tell me Is my subroutine is correct ? I mean passing of values from SAPscript and using them in subroutine are correct ? I suppose error is there only.

Read only

0 Likes
1,447

Hello,

One simple question.

If you cannot see the subroutine during the debugging, does that mean that you have not activated the SAPScript?

Can you tell me why you cannot go to the subroutine?

Thanks

Vinod

Read only

0 Likes
1,447

ITS ACTIVATED SIR

Read only

0 Likes
1,447

Normally if you have set a breakpoint in ur program, it should go there if it processes the exit. did u place the breakpoint at the first read statement? in both the read statements use index 1 instead of where.. and also use Changing instead of Using in SE71's perform.

try out..

pradhiba

Read only

0 Likes
1,447

Hello,

It will first take you to the script debugger and then it will take you to the program. Deactivate the script debugger and then run it it shoudl stop in the program. Put a couple of breakpoints.

Regards,

Shekhar Kulkarni

Read only

0 Likes
1,447

Hi Mave,

You should first put a break point in your form. If it is not working then only go for the script debugging.

Thanks

Vinod

Read only

Former Member
0 Likes
1,447

you must use

<b>/: changing</b> &OUTSYMBOL&

instead of

/: USING &OUTSYMBOL&

Read only

Former Member
0 Likes
1,447

Hi ,

Try with this

In the form change like

: DEFINE &MYSYMBOL& = &REGUH-VBLNR&

/: DEFINE &OUTSYMBOL& = &OUTSYMBOL&

AS &MYSYMBOL&

/: PERFORM EXTRACT IN PROGRAM ZSUBROUTINE1

/: USING &MYSYMBOL&

/: CHANGING &OUTSYMBOL&

/: ENDPERFORM.

AS &OUTSYMBOL&

FORM EXTRACT TABLES IN_PAR STRUCTURE ITCSY OUT_PAR STRUCTURE ITCSY.

TABLES : REGUP.

DATA : BILL_NO LIKE ITCSY-VALUE.

DATA : ITAB LIKE REGUP OCCURS 0 WITH HEADER LINE.

DATA : WRBTR1(13) TYPE C.

READ TABLE IN_PAR WITH KEY NAME = 'MYSYMBOL'.

IF SY-SUBRC = 0.

BILL_NO = IN_PAR-VALUE.

ENDIF.

SELECT * FROM REGUP INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE

VBLNR = BILL_NO.

LOOP AT ITAB.

READ TABLE ITAB INDEX SY-TABIX..

IF SY-SUBRC = 0.

READ TABLE OUT_PAR WITH KEY NAME = 'OUTSYMBOL'

MOVE ITAB-WRBTR TO WRBTR1.

MOVE WRBTR1 TO OUT_PAR-VALUE.

MODIFY OUT_PAR.

ENDIF.

ENDLOOP.

ENDFORM.

if any problem first set the break point in the form routine and check whether the sub routine is called or not.

Cheers,

Sasi

Read only

Former Member
0 Likes
1,447

Hi ,

Try with this

In the form change like

: DEFINE &MYSYMBOL& = &REGUH-VBLNR&

/: DEFINE &OUTSYMBOL& = &OUTSYMBOL&

AS &MYSYMBOL&

/: PERFORM EXTRACT IN PROGRAM ZSUBROUTINE1

/: USING &MYSYMBOL&

/: CHANGING &OUTSYMBOL&

/: ENDPERFORM.

AS &OUTSYMBOL&

FORM EXTRACT TABLES IN_PAR STRUCTURE ITCSY OUT_PAR STRUCTURE ITCSY.

TABLES : REGUP.

DATA : BILL_NO LIKE ITCSY-VALUE.

DATA : ITAB LIKE REGUP OCCURS 0 WITH HEADER LINE.

DATA : WRBTR1(13) TYPE C.

READ TABLE IN_PAR WITH KEY NAME = 'MYSYMBOL'.

IF SY-SUBRC = 0.

BILL_NO = IN_PAR-VALUE.

ENDIF.

SELECT * FROM REGUP INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE

VBLNR = BILL_NO.

LOOP AT ITAB.

READ TABLE ITAB INDEX SY-TABIX..

IF SY-SUBRC = 0.

READ TABLE OUT_PAR WITH KEY NAME = 'OUTSYMBOL'

MOVE ITAB-WRBTR TO WRBTR1.

MOVE WRBTR1 TO OUT_PAR-VALUE.

MODIFY OUT_PAR.

ENDIF.

ENDLOOP.

ENDFORM.

if any problem first set the break point in the form routine and check whether the sub routine is called or not.

Cheers,

Sasi

Read only

Former Member
0 Likes
1,447

Hi,

Check with this

In the form modify like

: DEFINE &MYSYMBOL& = &REGUH-VBLNR&

/: DEFINE &OUTSYMBOL& = &OUTSYMBOL&

AS &MYSYMBOL&

/: PERFORM EXTRACT IN PROGRAM ZSUBROUTINE1

/: USING &MYSYMBOL&

/: changing &OUTSYMBOL&

/: ENDPERFORM.

AS &OUTSYMBOL&

  • modify

FORM EXTRACT TABLES IN_PAR STRUCTURE ITCSY OUT_PAR STRUCTURE ITCSY.

TABLES : REGUP.

DATA : BILL_NO LIKE ITCSY-VALUE.

DATA : ITAB LIKE REGUP OCCURS 0 WITH HEADER LINE.

DATA : WRBTR1(13) TYPE C.

READ TABLE IN_PAR WITH KEY NAME = 'MYSYMBOL'.

IF SY-SUBRC = 0.

BILL_NO = IN_PAR-VALUE.

ENDIF.

SELECT * FROM REGUP INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE

VBLNR = BILL_NO.

LOOP AT ITAB.

READ TABLE ITAB INDEX SY-TABIX..

IF SY-SUBRC = 0.

*modified

READ TABLE OUT_PAR WITH KEY NAME = 'OUTSYMBOL'.

MOVE ITAB-WRBTR TO WRBTR1.

MOVE WRBTR1 TO OUT_PAR-VALUE.

MODIFY OUT_PAR.

ENDIF.

ENDLOOP.

ENDFORM.

if the problem continues first set breakpoint in the form routine and check whether the routine is called or not.

Cheers

Sasi