cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

LSMW with object 0070 and program RV14BTCI, XK15 and non numerical vendor

0 Kudos
1,311

I am using LSMW with object 0070 and program RV14BTCI, with XK15.

I concatenate vendor, material, purchasing org, plant and inforecord type.

when using a numerical vendor, I add the leading zeroes but when the vendor is alphanumeric I need to add spaces.

the issue is that when I add the spaces after the vendor, the system does not recognize it and inserts data from the next field instead, affecting also the next fields

how can I concatenate spaces or an alphanumeric vendor into VAKEY?

alisa_schlossbergmajer_0-1730815284990.png

 

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

I found a simpler solution

alisa_schlossbergmajer_0-1731396382077.png

 

RaymondGiuseppi
Active Contributor
0 Kudos
I hope there are no vendors with 2 or more trailing spaces in their code?
0 Kudos

hello Raymond

no, these vendors are all the same format

Answers (3)

Answers (3)

nielsvo
Discoverer
0 Kudos

I ran into the same issue when populating tax condition records where country (ALAND) is actually defined as a CHAR3 field but typically only has 2 characters. So I used the "respecting blanks" statement in the concatenate code string and this works fine. Code:

* Target Field: BKOND2-VAKEY_LONG Variable key 255 Character
CONCATENATE
       price_conditions-aland
       price_conditions-taxk1
       price_conditions-taxm1

  INTO bkond2-vakey_long respecting blanks.

RaymondGiuseppi
Active Contributor
0 Kudos

CONCATENATE RESPECTING BLANKS

RaymondGiuseppi
Active Contributor
0 Kudos

You could pass the key values to structure KOMG, then use a FM such as SD_CONDITION_VAKEY_FILL to fill VAKEY.

0 Kudos
hello Raymond, I have no idea how to do that in the LSMW
RaymondGiuseppi
Active Contributor
0 Kudos
Replace your concatenate fields with some moves, such as KONG-MATNR = field_matnr and then call the FM
0 Kudos

hallo Sandra

thank you for the reply.

generally speaking I am aware of the fact that trailing spaces are ignored in ABAP and I can see that also in table LFA1 in the unconverted value of the vendor.

But it seems that in VAKEY they are: in fact I tried to add the spaces before the vendor and the system saw it, the fields were correct in their right spaces: the issue was that the system did not recognize the vendor because it considered the spaces

alisa_schlossbergmajer_0-1730816507148.png

 

RaymondGiuseppi
Active Contributor
0 Kudos
Do not use Answer to respond to a comment or answer. Answer is intended to be used to propose a solution to the initial question. Use Comment instead.
0 Kudos
hello Raymond, there is no other options to Sandra's comment
RaymondGiuseppi
Active Contributor
0 Kudos
(Use comment on our original question)