Application Development 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: 

7 character field to purchase order ,customer number

Former Member
0 Kudos

please help

1)

data : kunnr1(7) type c.

data : kunnr like kna1-kunnr.

kunnr1 has only field length 7 and it is of type character.

kunnr is a sap field.

everytime i need to fill the data from the field kunnr1 to sap kunnr and pass to bdc .

suppose kunnr1 = 1930903 ie 7 characters .

and in sap shall i simply copy like this

kunnr = kunnr1. " will this work

or

concatnate '000' kunnr1 to kunnr.

or

any other one .

2)same with the purchase order number.

data : po(7) type c.

dat : bstdk type vbak-bstdk.

po = asdefgr

bsdtk = po

or

concatenate '' po to bsdtk.

if i assign value from po to bsdtk will at end command will work on bstdk?

example

loop at itab into workarea.

at last bsdtk." i need this to work so tell me how to assign the value from po to bsdtk

endloop.

8 REPLIES 8

sridhar_meesala
Active Contributor
0 Kudos

Hi,

kunnr = kunnr1.

po = bsdtk.

will work.

Thanks,

Sri.

0 Kudos

kunnr1 and po are only 7 charas, then how they will be adjusted to 10 in sao if we simply pass like this

kunnr = kunnr1

bstdk = po

will this be added as from first to last or from last to first. I mean

first to last

kunnr = 1022200and the rest three spaces

kunnr= first three chars spaces and then1022200.

because i need to use this value to update the database tables.

please suggest

0 Kudos

Hi,

If both are of same length then it is possible.

Thanks,

Sri.

0 Kudos

Hi,

Pass like this


CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = kunnr1
      IMPORTING
        output = kunnr


CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = po
      IMPORTING
        output = bstdk

Regards,

Vik

0 Kudos

i checked the customer number in sap system,

in the sales order it is stored as 1277494

i checked in vbak table and it is stored as 1277494and rest blank spaces.

i checked in kna1 table , the same kunnr is stored as 0001277494.

why is this difference?

so i need to use the 'CONVERSION_EXIT_ALPHA_INPUT' for kunnr?

I checked for po but that is stored as a charater format and no need to add the leading zeros, is that right?

I used CONVERSION_EXIT_MATN1_INPUT for material do i need to use CONVERSION_EXIT_ALPHA_INPUT for material also?

thank you for the solutions given.

0 Kudos

How do you check, tools like SE16/SE16n execute conversion exits.

Use the conversion input exit associated with the DOMAIN of the field.

Regards,

Raymond

Former Member
0 Kudos

Hi,

The simple assignment statement will work even if you use it with AT END ... ENDAT inside a loop.

kunnr = kunnr1.

bsdtk = po.

You have to use the conversion rouine 'CONVERSION_EXIT_ALPHA_INPUT' if you want to append the leading zeros and make the length to that of the database field.

Regards,

Vik

raymond_giuseppi
Active Contributor
0 Kudos

If you use BDC just move the data, during the execution of the session the standard conversion exits (like ALPHA) will convert from external format to internal data.

If you use BAPI, some FM of fill some CUSTOMERS tables via OpenSQL, use CONVERSION_EXIT_ALPHA_INPUT to convert to internal format.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
     EXPORTING
          input  = kunnr1
     IMPORTING
          output = kunnr.

Regards,

Raymond