Skip to Content

Can we change the value of a variable in the driver program from sapscript?

Hello Experts,

I am currently developing a form wherein I need to change the value of a variable defined in the standard

driver program through the sapscript form. Unfortunately, I cannot customize this standard program since this is used by many other

subsidiaries. So, is there anyway that I can change a variable defined in the driver program via sapscript?

I tried to use a PERFORM to change its value but it is not working.

I hope you can help me guys. Thank you and take care!

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Dec 18, 2008 at 07:59 AM

    Hi,

    You can do it using PERFORM statement, can you paste how you wrote your PERFORM statement and its corresponding Subroutine

    Regards

    Bala Krishna

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      If you use the same variable BKPF-GJHAR, its value will be always same in form, as it is coming from the Driver program.

      In the above subroutine program it changes the value according to condition, if conditions fails it retains the original value.

      Regards

      Bala Krishna

      Edited by: Bala Krishna on Dec 19, 2008 11:46 AM

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 07:55 AM

    SAP SCRIPT:

    /: PERFORM GET_ATTNDEE_INFO IN PROGRAM ZHR_TRNG

    /: USING &PPVAR-EOBJD&

    /: CHANGING &ATTND&

    /: ENDPERFORM

    Executable Prog.:

    REPORT ZHR_TRNG.

    FORM GET_ATTNDEE_INFO TABLES IN_PAR STRUCTURE ITCSY

    OUT_PAR STRUCTURE ITCSY.

    DATA : LOC_CODE(8),

    WF_NAME LIKE PA0001-ENAME, "----Location Code

    WF_SOBID LIKE HRP1001-SOBID. "----Business Event Code

    DATA: BEGIN OF ITAB_ECODE OCCURS 0,

    ECODE(8),

    END OF ITAB_ECODE.

    DATA: NAME1 TYPE STRING.

    READ TABLE IN_PAR INDEX 1.

    LOC_CODE = IN_PAR-VALUE.

    SELECT SOBID FROM HRP1001 INTO WF_SOBID

    WHERE OBJID = LOC_CODE AND OTYPE ='E' AND PLVAR = '01' AND SCLAS = 'P'.

    APPEND WF_SOBID TO ITAB_ECODE .

    ENDSELECT.

    IF SY-SUBRC = 0.

    LOOP AT ITAB_ECODE.

    SELECT SINGLE ENAME FROM PA0001 INTO WF_NAME

    WHERE PERNR = ITAB_ECODE-ECODE ." AND ENDDA >= '31.12.9999' .

    CONCATENATE 'Mr ' WF_NAME ',' NAME1 INTO NAME1.

    IF SY-SUBRC = 0 .

    OUT_PAR-NAME = 'ATTND'.

    OUT_PAR-VALUE = NAME1.

    APPEND OUT_PAR.

    ENDIF.

    ENDLOOP.

    ENDIF.

    ENDFORM. "GET_USR_INFO

    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.