cancel
Showing results for 
Search instead for 
Did you mean: 

perform statment in script

Former Member
0 Kudos

I have written form statment in subroutine program and calling in script layout using perform statment it is not calling in the script.

i written following code in the subroutine program .

PROGRAM ZWHDTAX.

form WHDTAX tables in_tab structure itcsy

out_tab structure itcsy.

data: A_SKFBT type regup-skfbt,

A_WRBTR type regud-wrbtr ,

C_WTAX TYPE regup-skfbt,

E_FLOAT TYPE F,

E_DEC TYPE ESECOMPAVG,

E_DECIMALS TYPE I,

TELNUMBER1(30) TYPE C.

read table in_tab WITH KEY NAME = 'REGUP-SKFBT'.

check sy-subrc = 0.

MOVE IN_TAB-VALUE TO TELNUMBER1.

CALL FUNCTION 'C14W_CHAR_NUMBER_CONVERSION'

EXPORTING

I_STRING = TELNUMBER1

IMPORTING

E_FLOAT = E_FLOAT

E_DEC = E_DEC

E_DECIMALS = E_DECIMALS

  • EXCEPTIONS

  • WRONG_CHARACTERS = 1

  • FIRST_CHARACTER_WRONG = 2

  • ARITHMETIC_SIGN = 3

  • MULTIPLE_DECIMAL_SEPARATOR = 4

  • THOUSANDSEP_IN_DECIMAL = 5

  • THOUSAND_SEPARATOR = 6

  • NUMBER_TOO_BIG = 7

  • OTHERS = 8

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

.

A_SKFBT = E_DEC.

CLEAR TELNUMBER1.

read table in_tab WITH KEY NAME = 'REGUD-WRBTR'.

check sy-subrc = 0.

MOVE IN_TAB-VALUE TO TELNUMBER1.

CALL FUNCTION 'C14W_CHAR_NUMBER_CONVERSION'

EXPORTING

I_STRING = TELNUMBER1

IMPORTING

E_FLOAT = E_FLOAT

E_DEC = E_DEC

E_DECIMALS = E_DECIMALS

  • EXCEPTIONS

  • WRONG_CHARACTERS = 1

  • FIRST_CHARACTER_WRONG = 2

  • ARITHMETIC_SIGN = 3

  • MULTIPLE_DECIMAL_SEPARATOR = 4

  • THOUSANDSEP_IN_DECIMAL = 5

  • THOUSAND_SEPARATOR = 6

  • NUMBER_TOO_BIG = 7

  • OTHERS = 8

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

.

A_WRBTR = E_DEC.

C_WTAX = A_SKFBT - A_WRBTR.

read table out_tab index 1.

check sy-subrc = 0.

out_tab-value = C_WTAX.

modify out_tab index 1.

*endif .

endform.

following code i written in script layout it is not calling in the script.

/:PERFORM WHDTAX IN PROGRAM ZWHDTAX

/:USING &REGUP-SKFBT&

/:USING &REGUD-WRBTR&

/:CHANGING &C_WTAX&

/:ENDPERFORM.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Venkat,

Instead of what you have written as below:

read table out_tab index 1.

check sy-subrc = 0.

out_tab-value = C_WTAX.

modify out_tab index 1.

*endif .

endform.

just read the table out_tab with key C_WTAX and then assign the value to out_Tab-value and then modify the table. This helps, i had a similar problem and doing this solved.!!!

Regards,

Narendra.

Reward points if helpful!!!

Former Member
0 Kudos

Hi Venkat,

In order to get the changed value in C_WTAX you should read the internal table OUT_TAB with key 'C_WTAX' i.e. the variable that is used in CHANGING statement.

Once you do this and assign value to OUT_TAB and modify it, it will be displayed on script.

Regards,

Anil

Please reward if helpful!!!

FredericGirod
Active Contributor
0 Kudos

The modification of your table is not really clean.

here one of my example:

----


  • FORM P_GET_DATA_FEBCL *

----


  • Get data for the FORM ZF_M40S_CHEQUE of the table FEBCL *

----


FORM p_get_data_febcl TABLES it_in STRUCTURE itcsy

it_out STRUCTURE itcsy.

DATA : w_kukey TYPE kukey_eb ,

w_esnum TYPE esnum_eb ,

w_selvon TYPE sel01_f05a .

  • Get the value of the parameter KUKEY.

READ TABLE it_in

WITH KEY name = 'FEBEP-KUKEY'.

IF sy-subrc EQ space.

MOVE it_in-value TO w_kukey.

ENDIF.

  • Get the value of the parameter ESNUM.

READ TABLE it_in

WITH KEY name = 'FEBEP-ESNUM'.

IF sy-subrc EQ space.

MOVE it_in-value TO w_esnum.

ENDIF.

  • Select the value of ZUONR.

SELECT selvon

UP TO 1 ROWS

INTO w_selvon

FROM febcl

WHERE kukey EQ w_kukey

AND esnum EQ w_esnum

AND selfd EQ 'ZUONR'.

ENDSELECT.

  • Send back the value of the ZUONR field.

IF sy-subrc EQ space.

READ TABLE it_out

WITH KEY name = 'ZUONR'.

IF sy-subrc EQ space.

MOVE w_selvon TO it_out-value.

MODIFY it_out INDEX sy-tabix.

ENDIF.

ENDIF.

ENDFORM. " P_GET_DATA_FEBCL.