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

Displaying kunnr value problem

Former Member
0 Likes
874

Hi,

im displaying bill to party address in scripts using subroutine.my code is like this.

PERFORM GET_BILL_TO_PARTY_ADDRESS IN PROGRAM ZSP_SD_ORDCM.

USING &VBDKA-VBELN&

CHANGING &V_KUNNR1&

CHANGING &V_ANRED&

CHANGING &V_NAME1&

CHANGING &V_NAME2&

CHANGING &V_PFACH&

CHANGING &V_ORT01&

CHANGING &V_REGIO&

CHANGING &V_STRAS&

CHANGING &V_PSTLZ&

ENDPERFORM.

Displaying the Bill to Party Address in Address Window

&V_KUNNR1(Z)&

&V_NAME1&

&V_NAME2&

&V_STRAS&

&V_ORT01& &V_REGIO& &V_PSTLZ&

In se38

FORM get_ship_to_party_address TABLES it_input STRUCTURE itcsy it_output STRUCTURE itcsy.

CLEAR : v_kunnr1,v_anred,v_name1,v_name2,v_pfach,v_ort01,v_regio,v_stras,v_pstlz,v_kunnr.

REFRESH : it_input,it_output.

READ TABLE it_input INDEX 1.

MOVE it_input-value TO v_vbeln.

  • read the Sales Document Partner table for Bill to Party Customer

SELECT SINGLE kunnr INTO v_kunnr FROM vbpa WHERE vbeln = v_vbeln AND parvw = 'WE'.

IF sy-subrc = 0.

SHIFT v_kunnr RIGHT DELETING TRAILING space.

OVERLAY v_kunnr WITH '0000000000'.

  • get the Bill to Party Address Details from Customer Master table

SELECT SINGLE kunnr anred name1 name2 pfach ort01 regio stras pstlz

INTO (v_kunnr1,v_anred,v_name1,v_name2,v_pfach,v_ort01,v_regio,v_stras,v_pstlz)

FROM kna1 WHERE kunnr = v_kunnr.

*It_output index1 will have the Document Number

READ TABLE it_output INDEX 1.

MOVE v_kunnr1 TO it_output-value.

MODIFY it_output INDEX 1.

*It_output index2 will have the Title

READ TABLE it_output INDEX 2.

MOVE v_anred TO it_output-value.

MODIFY it_output INDEX 2.

*It_output index3 will have First Name of the Customer

READ TABLE it_output INDEX 3.

MOVE v_name1 TO it_output-value.

MODIFY it_output INDEX 3.

*It_output index4 will have Second Name of the Customer

READ TABLE it_output INDEX 4.

MOVE v_name2 TO it_output-value.

MODIFY it_output INDEX 4.

*It_output index5 will have the Post Box Number

READ TABLE it_output INDEX 5.

MOVE v_pfach TO it_output-value.

MODIFY it_output INDEX 5.

*It_output index6 will have the City

READ TABLE it_output INDEX 6.

MOVE v_ort01 TO it_output-value.

MODIFY it_output INDEX 6.

*It_output index7 will have the Region

READ TABLE it_output INDEX 7.

MOVE v_regio TO it_output-value.

MODIFY it_output INDEX 7.

*It_output index8 will have the PO BOX PostalCode

READ TABLE it_output INDEX 8.

MOVE v_stras TO it_output-value.

MODIFY it_output INDEX 8.

*It_output index9 will have the PO BOX PostalCode

READ TABLE it_output INDEX 9.

MOVE v_pstlz TO it_output-value.

MODIFY it_output INDEX 9.

ENDIF.

ENDFORM. "

Here my problem is when im displaying kunnr value i.e:v_kunnr1 it's displying like 0000000002

but i want to display it as 2

Thanks,

Srinivas

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
793

Hi,

Try using the option &v_kunnr1(Z)&. it is used to omit leading zeros or use the FM

CONVERSION_EXIT_ALPHA_OUTPUT in the Perform to omit them.

regards,

Mahesh

4 REPLIES 4
Read only

Former Member
0 Likes
794

Hi,

Try using the option &v_kunnr1(Z)&. it is used to omit leading zeros or use the FM

CONVERSION_EXIT_ALPHA_OUTPUT in the Perform to omit them.

regards,

Mahesh

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
793

Hi Srini,

Try using SHIFT LEFT deleting leading zeros before passing KUNNR value to script.

*Reward if helps.

Read only

Former Member
0 Likes
793

hello in ur code other than display kunnr value

just check this..

  • read the Sales Document Partner table for Bill to Party Customer

SELECT SINGLE kunnr INTO v_kunnr FROM vbpa WHERE vbeln = v_vbeln AND parvw = 'WE'.

cause 'WE ' is for ship to party

here parvw = <b>'RE'</b> " for bill to

2. comment this ..

*OVERLAY v_kunnr WITH '0000000000'

vijay

Read only

Former Member
0 Likes
793

Hi,

By Using Shift it's working fine.

Thanks to all.