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

extract data from PA0002

Former Member
0 Likes
373

Hi experts

I need a program to extract data from PA0002-INITS. it needs first get data from KNVP-PARVW, then to check table PA0002 to get INITS.

can anybody help me?

promise to reward points if helps.

thanks

elly

Hi experts

I need a program to extract data from PA0002-INITS. it needs first get data from KNVP-PARVW, then to check table PA0002 to get INITS.

can anybody help me?

promise to reward points if helps.

thanks

elly

1 REPLY 1
Read only

Former Member
0 Likes
314

Hmmmmm, don't unsderstand exactly the problem..........

Key for PA0002 is PERNR, so select your record from KNVP based on knvp-keys:

- KUNNR

- VKORG

- VTWEG

- SPART

- PARVW

This will give a you a KNVP-PERNR, with which you can address the PA0002 table and give you the right record.

I would do it like this:


DATA: lf_pernr TYPE pernr_d,
      lf_inits TYPE inits.

SELECT SINGLE pernr
  INTO lf_pernr
  FROM knvp
 WHERE kunnr = 'your CUSTNO'
   AND vkorg = 'your sales org'
   AND vtweg = 'your distr.chann'
   AND spart = 'your div'
   AND parvw = 'your partn. func'.
    
IF sy-subrc = 0.
  SELECT SINGLE inits
   INTO lf_inits
   FROM pa0002
 WHERE pernr = lf_pernr.
ENDIF.