Skip to Content
avatar image
Former Member

How do I map VTWEG to KUNNR with SELECT?

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Feb 14, 2017 at 12:10 PM

    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.
    Add comment
    10|10000 characters needed characters exceeded

  • Feb 14, 2017 at 12:05 PM

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

    Add comment
    10|10000 characters needed characters exceeded