cancel
Showing results for 
Search instead for 
Did you mean: 

arithmetic operations in scripts

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.