Skip to Content
0

How do I map VTWEG to KUNNR with SELECT?

Feb 14, 2017 at 09:56 AM

93

avatar image

I have to read from KNVV in the target system the VTWEG for certain created customers, based on the VKORG. I have until now this:

data: lv_kunnr type kunnr.

select single kunnr from knvv into lv_kunnr
  where kunnr = target-kunnr and
        vkorg = 'xxxx'.
if sy-subrc = 0.
  skip_knb1 = 'X'.
...................
endif.

Where the dots are, I should implement another select such that all VTWEGs for the selected KUNNR and VKORG are mapped to each customer and then:

target-vtweg = ???-vtweg.

Please support in implementing.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Madalina Moisa Feb 14, 2017 at 12:10 PM
0

You're right...I managed to get things working with:

select single vtweg from knvv into lv_vtweg
   where kunnr = target-kunnr.

target-vtweg = lv_vtweg.
Show 2 Share
10 |10000 characters needed characters left characters exceeded

You forgot the "vkorg ='xxxx'" in the where clause. Also depending on your Customizing there can be multiple values for wtweg?

1

Yeah, I figured out that ^^. It's only one VTWEG value in my case.

Thank you, nevertheless!

0
Raymond Giuseppi
Feb 14, 2017 at 12:05 PM
1

Why didn't you already select every VTWEG value in the first select, but INTO TABLE some internal table?

Share
10 |10000 characters needed characters left characters exceeded