Skip to Content
author's profile photo Former Member
Former Member

SAP script debugging

Hi experts,

i am new to sapscripts,

i want to do Retrieving data without modifying the original called program .

i got one exmplae program from sap img site.

i copied form into my z_medruck1 then i am calling the subroutine in my header window(PERFORM GET_BARCODE IN PROGRAM ZSCRIPTPERFORM).

i wrote the ZSCRIPTPERFORM as shown below.

now i want to know how to debugg this program.

or else you can give some other example programs then i can understand easily.

help...

Retrieving data without modifying the original called program

*

  • Retrieving data without modifying the original called program

*

  • Put this script code in your sapscripts

  • /: PERFORM GET_BARCODE IN PROGRAM ZSCRIPTPERFORM

  • /: USING &PAGE&

  • /: USING &NEXTPAGE&

  • /: CHANGING &BARCODE&

  • /: ENDPERFORM

  • / &BARCODE&

*

REPORT ZSCRIPTPERFORM.

FORM GET_BARCODE TABLES IN_PAR STRUCTURE ITCSY

OUT_PAR STRUCTURE ITCSY.

DATA: PAGNUM LIKE SY-TABIX, "page number

NEXTPAGE LIKE SY-TABIX. "number of next page

READ TABLE IN_PAR WITH KEY 'PAGE'.

CHECK SY-SUBRC = 0.

PAGNUM = IN_PAR-VALUE.

READ TABLE IN_PAR WITH KEY 'NEXTPAGE'.

CHECK SY-SUBRC = 0.

NEXTPAGE = IN_PAR-VALUE.

READ TABLE OUT_PAR WITH KEY 'BARCODE'.

CHECK SY-SUBRC = 0.

IF PAGNUM = 1.

OUT_PAR-VALUE = '|'. "First page

ELSE.

OUT_PAR-VALUE = '||'. "Next page

ENDIF.

IF NEXTPAGE = 0.

OUT_PAR-VALUE+2 = 'L'. "Flag: last page

ENDIF.

MODIFY OUT_PAR INDEX SY-TABIX.

ENDFORM.

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2005 at 06:27 AM

    Hi,

    Script:In SE71 give your form name and in Utilities-->Active debugger.

    Then put a break point in your print prog where ever you want to stop it.

    After that you need to go to your transaction like VF03/../..etc for Invoice you need to execute it by giving Outtype.

    Then your print prog and form will debugg step by step.

    Thanks.

    Message was edited by: Deepak333 k

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      HI

      as i shown above the example program for printing barcode

      in purchase order form(header window in z_medruck1)

      when i test my form z_medruck1 i can see the bar code in

      print preview.

      but when i am create the purchse order through me21 and

      i test print privew i was not able to get barcode.

      where i was doing wrong?

      please help me

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2005 at 04:23 AM

    please explain and give some examples Retrieving data without modifying the original called program .

    please help..

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2005 at 04:19 AM

    Hy,

    To debugg a sapscript GOTO->UTILITIES->ACTIVE DEBUGGER.

    REGARDS,

    KARTIKEY

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2005 at 04:35 AM

    SO WHILE U WILL DEBUG THE SCRIPT WHEN U COME TO THE PERFORM PART, U WILL HAVE TO CHECK THAT PROGRAM FROM WHERE IT'S TAKING THE VALUES.

    REGSRDA,

    KARTIKEY,.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.