Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

input field

Former Member
0 Likes
422

hi, how to input tax number on my report in sapscript

@kna1-stcd2@

i used

/: PERFORM GETPIB IN PROGRAM ZRECHDAT

/: USING &VBDKA-KUNNR&

/: CHANGING &STCD2&

/: ENDPERFORM

AS <B>PIB: &STCD2&

and abap code

&----


*& Form GETPIB

&----


  • text

----


  • --> IN_PAR STRUCTURE ITCSY

  • <-- OUT_PAR STRUCTURE ITCSY

----


FORM GETPIB TABLES IN_PAR STRUCTURE ITCSY

OUT_PAR STRUCTURE ITCSY.

DATA: LV_KUNNR TYPE KUNNR.

LOOP AT IN_PAR WHERE NAME = 'VBDKA-KUNNR'.

CONDENSE IN_PAR-VALUE.

MOVE IN_PAR-VALUE TO LV_KUNNR.

ENDLOOP.

IF SY-SUBRC <> 0 .

LOOP AT IN_PAR WHERE NAME = 'VBDKR-KUNRE'.

CONDENSE IN_PAR-VALUE.

MOVE IN_PAR-VALUE TO LV_KUNNR.

ENDLOOP.

ENDIF.

LOOP AT OUT_PAR WHERE NAME = 'STCD2'.

SELECT SINGLE STCD2 FROM KNA1 INTO

OUT_PAR-VALUE WHERE KUNNR = LV_KUNNR.

MODIFY OUT_PAR INDEX SY-TABIX.

ENDLOOP.

ENDFORM. " GETP

dont have result!!!

should i took that code in mz program or...?

3 REPLIES 3
Read only

Former Member
0 Likes
389

Hi

You have to convert the format output of customer code:

LOOP AT IN_PAR WHERE NAME = 'VBDKA-KUNNR'.

CONDENSE IN_PAR-VALUE.

MOVE IN_PAR-VALUE TO LV_KUNNR.

ENDLOOP.

IF SY-SUBRC <> 0 .

LOOP AT IN_PAR WHERE NAME = 'VBDKR-KUNRE'.

CONDENSE IN_PAR-VALUE.

MOVE IN_PAR-VALUE TO LV_KUNNR.

ENDLOOP.

ENDIF.

<b>CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = LV_KUNNR

IMPORTING

OUTPUT = LV_KUNNR. </b>

LOOP AT OUT_PAR WHERE NAME = 'STCD2'.

SELECT SINGLE STCD2 FROM KNA1 INTO

OUT_PAR-VALUE WHERE KUNNR = LV_KUNNR.

MODIFY OUT_PAR INDEX SY-TABIX.

ENDLOOP.

Max

Read only

Former Member
0 Likes
389

Did you define &STCD2& before using it in the script?

/: DEFINE &STCD2& := '&SPACE(12)&'

Read only

Former Member
0 Likes
389

i guess you have to make using &KNA1-STCD2& changing &KNA1-STCD2& because &STCD2& is unknow in the form.