a month ago
Hello Experts,
I need implement the BAdI, that allow create reate object relation for adapting employee organizational assignment
I need create a relationship between the object S and Custom
The BADI have a method IF_SFIOM_ADAPT_EE_ORG_ASSGNMNT~CREATE_OBJECT_RELATION for Create object relation
The information organizational comes as a parameter in the internal table is_ee_org_ass_repl_req-org_assignment
For each employee who goes through this BADI, and processes their organizational assignment
I need read the infotype hrp1013 for get the employee type where when the employee type = 1
LOOP AT is_ee_org_ass_repl_req-org_assignment INTO DATA(ls_org_assignment).
SELECT SINGLE persg FROM hrp1013 INTO @DATA(lv_empsgrp)
WHERE plvar = '01'
AND otype = 'S'
AND objid = @LS_org_assignment-position_id
AND istat = '1'
AND begda LE @LS_org_assignment-end_date
AND endda GE @LS_org_assignment-end_date.
IF SY-SUBRC = 0.
" Apply my logic here
ENDIF.
ENDLOOP.
How can avoid issue of performance and not use a select in the LOOP ?
Regards
Request clarification before answering.
You could define an attribute of the implementing class as a sorted type table to save the result of the SELECT and then only select from database if not already saved. You could also reduce the number of criteria in the SELECT to exchange speed vd memory.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
SELECT a~OBJID, a~OTYPE
FROM hrp1013 AS a INNER JOIN is_ee_org_ass_repl_req-org_assignment AS b
ON a~OBJID EQ b~OBJID.
And when I tried of active genered the error:
1 errors found. Activate anyway?
Line 156: The table
name "IS_EE_ORG_ASS_REPL_REQ-ORG_ASSIGNMENT" is
too long. long. It may not be unique.
Hi Sandra, This is the information of My system :
And with this information not can joining an internal table.
Now, I want use SELECT FOR ALL ENTRIES, however I have a doubt with the use of the instruction for my scenarie.
The system standard have a LOOP and When the system call the BADI, send all the records of the assignment for each employee.
This information is received in the table
is_ee_org_ass_repl_req-org_assignment
For avoid have a SELECT in LOOP. You recommendation is: SELECT FOR ALL ENTRIES,
If I undestand you idea , i Should do the following:
1. Before do a LOOP to the internal table is_ee_org_ass_repl_req-org_assignment , I shoud use the following instuctions and have in the table lt_result_1013, all the employee that have employeeclass = 1,
SELECT result
FROM HRP1013
INTO|APPENDING lt_result_1013
[[FOR ALL ENTRIES IN is_ee_org_ass_repl_req-org_assignment ] WHERE sql_cond] …
And with avoid the SELECT in the LOOP and can check this using a READ TABLE in LOOP at:
LOOP AT is_ee_org_ass_repl_req-org_assignment INTO DATA(ls_org_assignment).
READ TABLE lt_result_1013 ....
ENDLOOP
This is rigth?
Regards
User | Count |
---|---|
52 | |
8 | |
5 | |
5 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.