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

How to find the structure requires in wrintg SAPscript?

hi all gurus,

I've some doubts regarding the sapscripts.I understand the usage of perform which is calling a subroutines from abap program.my doubt here is whenever i writing the sapscript,i need to pass the value..for example &cust_name$ to the subroutines inorder for it to search for..let say customer ID. how should i know tat the &cust_name& is actually from which structures?

Thank You.

Add a comment
10|10000 characters needed characters exceeded

Related questions

8 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 02:24 AM

    Please explain your requirement in detail..You want to know how to receive parameters in the subroutine in the print program..Is that your requirement..

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 02:30 AM

    Hi Joan

    Incase of using variables w.r.t structures, it can be used as &<wa>-fld1&. In this case <wa> is a structure.

    Alternatively, through the print program the value of this field can be moved to a structure and pass it to the form.

    Eg:

    Print Program:

    <temp_var> = <wa>-fld1.

    Form:

    &<temp_var>&

    Hope the above info can give you some idea.

    Kind Regards

    Eswar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 02:36 AM

    hi Naren,

    i wish to know hw whihc structure i shd take the value out and pass it to the subroutine.

    for example,

    PERFORM CONTACT_PERSON IN PROGRAM ZMPOI001

    USING &EKKO-LIFNR&

    CHANGING &CONTACT_PERSON&

    ENDPERFORM

    how do i kow tat i need to use EKKO-LIFNR this structure rather than others? thank you

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 02:38 AM

    thx Eswar..but am still kinda blur over here

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 02:43 AM

    Hi,

    Check this sample code..

    >PERFORM CONTACT_PERSON IN PROGRAM ZMPOI001

    >USING &EKKO-LIFNR&

    >CHANGING &CONTACT_PERSON&

    FORM CONTACT_PERSON TABLES IN_PAR STUCTURE ITCSY

    OUT_PAR STRUCTURE ITCSY.

    READ TABLE IN_PAR WITH KEY 'EKKO-LIFNR'.

    CHECK SY-SUBRC = 0.

    READ TABLE OUT_PAR WITH KEY 'CONTACT_PERSON'.

    CHECK SY-SUBRC = 0.

    OUT_PAR-VALUE = 'TEST'.

    MODIFY OUT_PAR INDEX SY-TABIX.

    ENDFORM.

    Is this your requirement..

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Joan

      I guess you are having problem with what variables to be used in a FORM.

      If i am right, below info can help you.

      1. Every form is associated with a Print Program as a form can not itself be called without a print program.

      2. So w.r.t to the print program, we can know the variables or structures or infact the data need to print.

      Kind Regards

      Eswar

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 02:53 AM

    Hi,

    Check in the print program of the corresponding sapscript to check the structure name used in the subroutine...

    If you want to know which program is used for the sapscript check the transaction NACE..

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 03:03 AM

    thx Naren and Eswar

    Eswar,

    Yeah,tat's d problem am facing now.Thx for the infor.by the way,mind i ask a dumb Q..where to find the print program? sorry as i am very new to SAP. Thank you.

    regards,

    Joan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 03:11 AM

    Hi,

    Check the table TNAPR or transaction NACE to get the print program for the corresponding sapscript.

    Thanks,

    Naren

    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.