Skip to Content
avatar image
Former Member

arithmetic operations in scripts

Hi,

I created one text symbol in script editor in Main Window using DEFINE statement and assigned the value zero. I used this text symbol under an element which is called from print program in an internal table loop. I need to increment the value of the text symbol for every loop pass. Please give me a solution.

Thanks,

Venkatesh.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Dec 31, 2008 at 09:57 AM

    hi,

    insted of declaring the symbol in script. declare in driver program and increment it in loop in the write form funciton modules if sysubrc equal zero then increment the value. and at last pass it to the script.

    thanks,

    anupama.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Anupama,

      I am using SAP standard driver program and i dont want to copy to a zprogram and modify it for that small change. Instead Can we do it from script itself?

      Thanks,

      Venkatesh.

  • avatar image
    Former Member
    Dec 31, 2008 at 12:17 PM

    Some times

    we write some performs in driver program some times in subroutine program

    in sapscript

    /: PERFORM GET_BILL_PARTNER IN PROGRAM XYZ(subroutine program name)

    /: USING &VBDKL-VBELN&

    /: CHANGING &BILL_TO_PART&

    /: ENDPERFORM

    code from subroutine program XYZ

    FORM get_bill_partner TABLES input_table STRUCTURE itcsy

    output_table STRUCTURE itcsy.

    DATA: lws_vbeln LIKE vbak-vbeln, "Sales Number

    lws_kunnr LIKE vbpa-kunnr,

    lws_parvw LIKE vbpa-parvw.

    • Read the input variables.

    LOOP AT input_table.

    lws_vbeln = input_table-value.

    ENDLOOP.

    *Add leading zero's to delivery number

    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

    EXPORTING

    input = lws_vbeln

    IMPORTING

    output = lws_vbeln.

    CALL FUNCTION 'CONVERSION_EXIT_PARVW_INPUT'

    EXPORTING

    input = 'BP'

    IMPORTING

    output = lws_parvw.

    SELECT SINGLE kunnr INTO lws_kunnr

    FROM vbpa

    WHERE vbeln = lws_vbeln

    AND parvw = lws_parvw.

    *Pass Ship-To Party value

    LOOP AT output_table.

    IF output_table-name = 'BILL_TO_PART'. "Description of Shipment

    output_table-value = lws_kunnr.

    ENDIF.

    MODIFY output_table.

    ENDLOOP.

    i guess your question will get resolved

    decaker variable as static if necessary

    Add comment
    10|10000 characters needed characters exceeded