Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SPLIT

Hi ,

i have to take 2 fielcd vorna and nachn from from pa0002 table according to emp id which is in our ondeveloped table and on that table we having one field in which there are multiple empid with comma

i want each emp id saperated and according to that i have to write select quarri. please help me

Tags:
Former Member
replied
data: it_tmp_ees type table of string,   "temporary table for EEs
        it_ees type table of string.          "your EEs table 
data: begin of it_ee_name occurs 0,       "table where you get EE +name (result table)
          pernr type pa0002-pernr,
          vorna type pa0002-vorna,
         nachn type pa0002-nachn,
       end of it_ee_name.

LOOP AT it.   "suppose your internal table is IT
  REFRESH it_tmp_ees.
  SPLIT it-empid AT ',' INTO TABLE it_tmp_ees.   "empid is your field where you have your EE ids
  APPEND LINES OF it_tmp_ees TO it_ees.      "append your EEs to destination table
ENDLOOP.

"now when you already have your EEs' ids in it_ees get PA0002 for them
SELECT pernr vorna nachn FROM PA0002 INTO CORRESPONDIG FIELDS OF TABLE it_ee_name
FOR ALL ENTRIES IN it_ees WHERE pernr = it_ees.

That's it.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question