Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

PAGE NUMBER IN SCRIPT

Hi Experts,

i have a selection screen parameter for user enter p_pagno(4) type c ,

if the user keyed in page no like 999(3 digit) the out put will be in the script form is 999(its ok),

and the user enter 1234(4 digit) the output will be 1234. but the user need the output will be

1,234. i have following program to convert the page no. from 1234 to 1.234. but i need ','

instead of '.'

Report test123.

FORM get_page3 TABLES in_tab STRUCTURE itcsy

  • ex_tab STRUCTURE itcsy "+021106

out_tab STRUCTURE itcsy.

*

    • Start +021106

  • READ TABLE ex_tab INDEX 1.

  • IF ex_tab-value = 'X'.

  • clear w_cnt.

  • ex_tab-value = ' '.

  • ENDIF.

    • End +021106

READ TABLE in_tab INDEX 1.

IF sy-subrc = 0.

v_page2 = in_tab-value.

ADD 1 TO w_cnt.

ENDIF.

READ TABLE out_tab INDEX 1. "tmp comment

IF sy-subrc = 0. "tmp comment

IF w_cnt = 1.

out_tab-value = v_page2.

WRITE v_page2 TO out_tab-value(5) NO-SIGN NO-ZERO.

ELSE.

v_pagenex2 = v_page2 + bil.

out_tab-value = v_pagenex2.

WRITE v_pagenex2 TO out_tab-value(5) NO-SIGN NO-ZERO.

ENDIF.

ADD 1 TO bil.

EXPORT bil TO MEMORY ID 'Z1'.

MODIFY out_tab INDEX 1.

ENDIF.

ENDFORM. "get_page

In Script editor FOR PAGENO WINDOW

PERFORM GET_PAGE3 IN PROGRAM TEST123

USING &P_PAGNO&

CHANGING &P_NO&

&P_NO&

pLZ ADVICE ME

tHANKS

rAJA

Former Member
Former Member replied

Hi,

DATA : l_pageno TYPE i.

l_pageno = v_page2.   " v_page contains 1234
WRITE l_pageno to out_tab-value.  " out_tab-value contains 1,234

Or 
use the REPLACE statement to replace the '.' with ','.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question