How to return value to user from a Search Help Exit - abap

I have a Search Help with many fields to be displayed to the user in order to apply values. I want to get 3 fields APOFASI, SKOPOS, KATDANL from the user.
In the CALLCONTROL-STEP = SELECT in the exit FM, I want to get these values in variables and then to make some selects and find another field APOFASISAP.
I am trying to pass back to the selection fields of the search help the field APOFASSISAP, but the APOFASI field seems to be blank.
The code is:
TYPES: BEGIN OF ty_apofasisap_tr,
apofasisap_tr TYPE zglk_sap_afopasi,
END OF ty_apofasisap_tr.
DATA: it_apofasisap_tr TYPE TABLE OF ty_apofasisap_tr,
wa_apofasisap_tr LIKE LINE OF it_apofasisap_tr.
DATA: lv_apofasi TYPE zglk_kyanr_ap,
lv_skopos TYPE zskopos,
lv_katdanl TYPE zsl_cat_dan,
lv_apofasisap_arx TYPE zglk_sap_afopasi.
lv_apofasi = wa_shlp_selopt-low.
ls_result-apofasi = ''.
IF lv_apofasi <> ''.
wa_shlp_selopt-low = ''.
MODIFY shlp-selopt FROM wa_shlp_selopt INDEX sy-tabix.
ENDIF.
READ TABLE shlp-selopt INTO wa_shlp_selopt WITH KEY shlpfield = 'SKOPOS'.
lv_skopos = wa_shlp_selopt-low.
READ TABLE shlp-selopt INTO wa_shlp_selopt WITH KEY shlpfield = 'KATDANL'.
lv_katdanl = wa_shlp_selopt-low.
SELECT SINGLE apofasisap INTO lv_apofasisap_arx
FROM zsl_glk_apof
WHERE apofasi = lv_apofasi.
SELECT * FROM zsl_glk_apof_tr
WHERE apofasisap_trp = lv_apofasisap_arx.
wa_apofasisap_tr-apofasisap_tr = zsl_glk_apof_tr-apofasisap_tr.
APPEND wa_apofasisap_tr TO it_apofasisap_tr.
ENDSELECT.
wa_shlp_selopt-shlpname = 'ZAPOF_TROP'.
wa_shlp_selopt-shlpfield = 'APOFASISAP'.
wa_shlp_selopt-sign = 'I'.
wa_shlp_selopt-option = 'EQ'.
wa_shlp_selopt-low = wa_apofasisap_tr-apofasisap_tr.
APPEND wa_shlp_selopt TO shlp-selopt.
This code does not replace/add the values to the appropriate fields.
Can someone help on this?
PS. Let me add another code that I wrote with the help of internet. It is in the STEP of DISPLAY.
IF callcontrol-step = 'DISP'.
TYPES: BEGIN OF ls_result,
apofasi LIKE zsl_glk_apof-apofasi,
apofasidate LIKE zsl_glk_apof-apofasidate,
apofasisap LIKE zsl_glk_apof-apofasisap,
apofasi_trp_x LIKE zsl_glk_apof-apofasi_trp_x,
apofasi_tr_x LIKE zsl_glk_apof-apofasi_tr_x,
fek LIKE zsl_glk_apof-fek,
katdanl LIKE zsl_glk_apof-katdanl,
reference LIKE zsl_glk_apof-reference,
skopos LIKE zsl_glk_apof-skopos,
thema LIKE zsl_glk_apof-thema,
type_desc LIKE zsl_glk_apof-type_desc,
ya_first LIKE zsl_glk_apof-ya_first,
END OF ls_result.
DATA: lt_result TYPE STANDARD TABLE OF ls_result.
CLEAR: lt_result, record_tab, record_tab[].
* Read the value that user gave
READ TABLE shlp-selopt INTO wa_shlp_selopt
WITH KEY shlpfield = 'APOFASI'.
lv_apofasi = wa_shlp_selopt-low.
IF lv_apofasi <> ''.
* Clear this value
wa_shlp_selopt-low = ''.
MODIFY shlp-selopt FROM wa_shlp_selopt INDEX sy-tabix.
ENDIF.
* Find the number starting APOFASISAP from the APOFASI text
SELECT SINGLE apofasisap INTO lv_apofasisap_arx
FROM zsl_glk_apof
WHERE apofasi = lv_apofasi.
IF sy-subrc = 0.
* Find the APOFASISAPs which changes the starting one and display the
*fields
SELECT a~apofasi a~apofasidate a~apofasisap
a~apofasi_tr_x a~apofasi_trp_x
a~thema a~fek a~reference a~ya_first
INTO CORRESPONDING FIELDS OF TABLE lt_result
FROM zsl_glk_apof AS a INNER JOIN zsl_glk_apof_tr AS b
ON a~apofasisap = b~apofasisap_tr
WHERE b~apofasisap_trp = lv_apofasisap_arx.
IF sy-subrc = 0.
*Pass them to display the result.
CALL FUNCTION 'F4UT_RESULTS_MAP'
EXPORTING
* SOURCE_STRUCTURE =
apply_restrictions = 'X'
TABLES
shlp_tab = shlp_tab
record_tab = record_tab
source_tab = lt_result
CHANGING
shlp = shlp
callcontrol = callcontrol
EXCEPTIONS
illegal_structure = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
FREE lt_result.
ENDIF.
It says NO VALUES FOR THIS SELECTION. The table lt_result contains 11 records.
Thanks again.

I agree with the forespeakers, that provided code is a mess, from which nothing can be figured out.
First of all, use DISP event in SHELP FM exit, not SELECT.
Secondly, you fill the wrong table (or do not show us right filling in the snippet above). In order to pass values back to user you should modify a RECORD_TAB table.
Your code should look something like this (joined selections from zsl_glk_apof and zsl_glk_apof_tr tables):
CHECK callcontrol-step = 'DISP'.
DATA: ls_selopt TYPE ddshselopt. "loc str for shlp-selopt
DATA: BEGIN OF ls_record.
INCLUDE STRUCTURE seahlpres.
DATA: END OF ls_record.
DATA: lv_glk_apof_tr TYPE zsl_glk_apof_tr-apofasisap_tr.
LOOP AT shlp-selopt INTO ls_selopt.
* finding SKOPOS and KATDANL values
CASE ls_selopt-shlpfield.
WHEN 'SKOPOS'.
lv_skopos = ls_selopt-low.
WHEN 'KATDANL'.
lv_katdanl = ls_selopt-low.
WHEN OTHERS.
ENDCASE.
* doing smth
* finding some stuff from Z-tables
SELECT SINGLE tr~apofasisap_tr
FROM zsl_glk_apof AS ap
JOIN zsl_glk_apof_tr AS tr
ON ap~apofasisap = tr~apofasisap_trp
INTO lv_glk_apof_tr
WHERE ap~apofasi = lv_apofasi.
ENDLOOP.
* modify record_tab with the found value lv_glk_apof_tr
LOOP AT record_tab INTO ls_record.
ls_record-string+25(5) = lv_glk_apof_tr. "field shift should be based on your values
ENDLOOP.

Hello and thanks all for your valuable help.
Finally I did it as follow:
if callcontrol-step = 'SELECT'.
get parameter id 'ZAP' field p_apofasi.
get parameter id 'ZSK' field p_skopos.
get parameter id 'ZKATDANL' field p_katdanl.
select single apofasisap into lv_apofasisap_arx
from zsl_glk_apof
where apofasi = p_apofasi and
katdanl = p_katdanl and
skopos = p_skopos.
select * into corresponding fields of table it_apofasisap_tr
from zsl_glk_apof_tr
where apofasisap_trp = lv_apofasisap_arx.
* Display the results to the user
types: begin of ls_result,
apofasi like zsl_glk_apof-apofasi,
apofasidate like zsl_glk_apof-apofasidate,
apofasisap like zsl_glk_apof-apofasisap,
apofasi_trp_x like zsl_glk_apof-apofasi_trp_x,
apofasi_tr_x like zsl_glk_apof-apofasi_tr_x,
katdanl like zsl_glk_apof-katdanl,
skopos like zsl_glk_apof-skopos,
type_desc like zsl_glk_apof-type_desc,
end of ls_result.
data: lt_result type standard table of ls_result.
clear: lt_result, record_tab, record_tab[].
* Fill all the fields of the Search-Help with the data according to the
*selections of the user.
select apofasi apofasidate apofasisap
apofasi_tr_x apofasi_trp_x
katdanl skopos type_desc
into corresponding fields of table lt_result
from zsl_glk_apof
for all entries in it_apofasisap_tr
where apofasisap = it_apofasisap_tr-apofasisap_tr and
apofasi_tr_x = 'X'. "lv_apofasi_tr_x.
call function 'F4UT_RESULTS_MAP'
tables
shlp_tab = shlp_tab
record_tab = record_tab
source_tab = lt_result
changing
shlp = shlp
callcontrol = callcontrol
exceptions
illegal_structure = 1
others = 2.
if sy-subrc = 0.
callcontrol-step = 'DISP'.
else.
callcontrol-step = 'EXIT'.
endif.
endif.
Regards
Elias

Related

Display data fields based on checkbox selection in SAP ABAP

Below is simple code where I want to display location based on checkbox selection.
Eg: id p_pune is selected at seletion screen then after WRITE command my output should be as below
EMPID NAME LOCATION
1 A PUNE
Code:
TYPES: BEGIN OF ty_emp,
empid TYPE i,
name TYPE char5,
location TYPE char6,
END OF ty_emp.
DATA: wa_emp TYPE ty_emp,
it_emp TYPE TABLE OF ty_emp.
DATA: gd_ucomm TYPE sy-ucomm.
wa_emp-empid = 1.
wa_emp-name = 'A'.
wa_emp-location = 'Pune'.
append wa_emp to it_emp.
CLEAR wa_emp.
wa_emp-empid = 2.
wa_emp-name = 'B'.
wa_emp-location = 'Mumbai'.
append wa_emp to it_emp.
CLEAR wa_emp.
wa_emp-empid = 3.
wa_emp-name = 'C'.
wa_emp-location = 'Delhi'.
append wa_emp to it_emp.
CLEAR wa_emp.
wa_emp-empid = 4.
wa_emp-name = 'D'.
wa_emp-location = 'Noida'.
append wa_emp to it_emp.
CLEAR wa_emp.
PARAMETERS: p_pune AS CHECKBOX USER-COMMAND c1,
p_mumbai AS CHECKBOX USER-COMMAND c2,
p_delhi AS CHECKBOX USER-COMMAND c3,
p_noida AS CHECKBOX USER-COMMAND c4.
You can try this:
IF p_pune = abap_true.
READ TABLE it_emp INTO wa_emp INDEX '1'.
WRITE:/ wa_emp-empid, wa_emp-name, wa_emp-location.
ENDIF.
IF p_mumbai = abap_true.
READ TABLE it_emp INTO wa_emp INDEX '2'.
WRITE:/ wa_emp-empid, wa_emp-name, wa_emp-location.
ENDIF.
IF p_delhi = abap_true.
READ TABLE it_emp INTO wa_emp INDEX '3'.
WRITE:/ wa_emp-empid, wa_emp-name, wa_emp-location.
ENDIF.
IF p_noida = abap_true.
READ TABLE it_emp INTO wa_emp INDEX '4'.
WRITE:/ wa_emp-empid, wa_emp-name, wa_emp-location.
ENDIF.
When you check multiple checkboxes, it will display multiple locations.
If you want to display only one location, I suggest you use RADIO BUTTON instead of CHECKBOX.
You could convert the boolean values of the parameters to a location, using the COND statement. Then you can loop over the internal table with LOOP AT and use it's WHERE condition to filter out the location you need.
TYPES:
BEGIN OF employee,
empid TYPE i,
name TYPE char5,
location TYPE char6,
END OF employee,
employees TYPE STANDARD TABLE OF employee WITH EMPTY KEY.
DATA(employees) = VALUE employees(
( empid = 1 name = 'A' location = 'Pune' )
( empid = 2 name = 'B' location = 'Mumbai' )
( empid = 3 name = 'C' location = 'Dehli' )
( empid = 4 name = 'D' location = 'Noida' )
).
PARAMETERS: pune AS CHECKBOX,
mumbai AS CHECKBOX,
dehli AS CHECKBOX,
noida AS CHECKBOX.
START-OF-SELECTION.
DATA(wanted_location) = COND char6(
WHEN pune = abap_true THEN 'Pune'
WHEN mumbai = abap_true THEN 'Mumbai'
WHEN dehli = abap_true THEN 'Dehli'
WHEN noida = abap_true THEN 'Noida'
).
LOOP AT employees INTO DATA(employee)
WHERE location = wanted_location.
WRITE:
employee-empid,
employee-location,
employee-name.
NEW-LINE.
ENDLOOP.

Why values are not displayed for some columns of an ALV List?

I am trying to create an ALV report with list display but some of the contents are not displaying in the output list. I created a classical report and an ALV report with grid display and I was successful. But this list display is creating a problem.
I've included the REUSE_ALV_LIST_DISPLAY function, with the right internal table name. I've debugged and all my data is coming in the final internal table correctly but it is not displaying in output list:
Here is my code (note that the flight demo data is to be generated via the program SAPBC_DATA_GENERATOR, once):
REPORT ztest.
SELECT scarr~carrid, spfli~connid
FROM scarr INNER JOIN spfli ON scarr~carrid = spfli~carrid
INTO TABLE #DATA(it_f).
DATA(it_fcat) = VALUE slis_t_fieldcat_alv(
( tabname = 'SCARR'
fieldname = 'CARRID'
seltext_l = 'Carrier code'
col_pos = 1
outputlen = 20 )
( tabname = 'SPFLI'
fieldname = 'CONNID'
seltext_l = 'Connection ID'
col_pos = 2
outputlen = 20 ) ).
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
it_fieldcat = it_fcat
TABLES
t_outtab = it_f.
In a simple ALV table, you don't have to fill the component TABNAME of the field catalog. TABNAME is only needed for the hierarchical-sequential lists (function module REUSE_ALV_HIERSEQ_LIST_DISPLAY for instance) which are an output of two tables.
If you omit it, or if you give the same value (any value) for all columns, you will get a correct output:
Code with the correction:
SELECT scarr~carrid, spfli~connid
FROM scarr INNER JOIN spfli ON scarr~carrid = spfli~carrid
INTO TABLE #DATA(it_f).
DATA(it_fcat) = VALUE slis_t_fieldcat_alv(
( " do not fill TABNAME // tabname = 'SCARR'
fieldname = 'CARRID'
seltext_l = 'Carrier code'
col_pos = 1
outputlen = 20 )
( " do not fill TABNAME // tabname = 'SPFLI'
fieldname = 'CONNID'
seltext_l = 'Connection ID'
col_pos = 2
outputlen = 20 ) ).
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
it_fieldcat = it_fcat
TABLES
t_outtab = it_f.
EDIT: I see that you two already solved the problem in comments.
As Sandra wrote, you could try using cl_salv_table. It should look like this:
cl_salv_table=>factory(
* EXPORTING
* list_display = if_salv_c_bool_sap=>true
* r_container =
* container_name =
IMPORTING
r_salv_table = DATA(lr_alv)
CHANGING
t_table = it_f
).
lr_alv->display( ).

Assign values to dynamic structure

Need idea on the below codes, on how to simplify. Codes below works good but is there a way I could enhance or shorten the codes making it dynamic?
TYPES: BEGIN OF lty_dates,
yesterday TYPE string,
today TYPE string,
tomorrow TYPE string,
END OF lty_dates.
DATA: it_table TYPE TABLE OF lty_dates.
DO 3 TIMES.
CASE lv_count.
WHEN 1.
it_table[ 1 ]-zyesterday = 'Result Yesterday'.
it_table[ 2 ]-zyesterday = 'Result Yesterday'.
it_table[ 3 ]-zyesterday = 'Result Yesterday'.
WHEN 2.
it_table[ 1 ]-ztoday = 'Result Today'.
it_table[ 2 ]-ztoday = 'Result today'.
it_table[ 3 ]-ztoday = 'Result Today'.
WHEN 3.
it_table[ 1 ]-ztommorrow = 'Result Tomorrow'.
it_table[ 2 ]-ztommorrow = 'Result Tomorrow'.
it_table[ 3 ]-ztommorrow = 'Result Tomorrow'.
ENDCASE.
lv_count = lv_count + 1.
ENDDO.
My idea is something like the below pseudocodes. I would not want to perform CASE multiple times specially instances if fields for it_table would reach 100 (fields).
DO 3 TIMES.
ASSIGN 'ZTODAY' TO <dynamic_fieldname>.
it_table[ 1 ]-<dynamic_fieldname> = <dynamic_result>.
it_table[ 2 ]-<dynamic_fieldname> = <dynamic_result>.
it_table[ 3 ]-<dynamic_fieldname> = <dynamic_result>.
ENDDO.
Please help or light me up on this.
You could use the command ASSIGN COMPONENT compname OF STRUCTURE structure TO <field_symbol>.
TYPES: BEGIN OF lty_dates,
yesterday TYPE string,
today TYPE string,
tomorrow TYPE string,
END OF lty_dates.
TYPES: BEGIN OF lty_result ,
fieldname TYPE fieldname,
result TYPE string,
END OF lty_result .
FIELD-SYMBOLS <data> TYPE any .
DATA: lt_table TYPE TABLE OF lty_dates,
lt_result TYPE TABLE OF lty_result.
lt_result = VALUE #( ( fieldname = 'yesterday'
result = 'Result Yesterday' )
( fieldname = 'today'
result = 'Result Today' )
( fieldname = 'tomorrow'
result = 'Result Tomorrow' ) ).
lt_table = VALUE #( ( ) ( ) ( ) ). " 3 empty lines
LOOP AT lt_table ASSIGNING FIELD-SYMBOL(<table>) .
LOOP AT lt_result ASSIGNING FIELD-SYMBOL(<result>) .
ASSIGN COMPONENT <result>-fieldname OF STRUCTURE <table> TO <data> .
<data> = <result>-result.
ENDLOOP .
ENDLOOP .
Actually, your code creates this result table:
YESTERDAY TODAY TOMORROW
Result Yesterday Result Today Result Tomorrow
Result Yesterday Result today Result Tomorrow
Result Yesterday Result Today Result Tomorrow
Why not to use macro for this? Macro can perfectly fulfill your needs:
FIELD-SYMBOLS: <fvalue> TYPE ANY.
DEFINE put_values.
ASSIGN COMPONENT &1 OF STRUCTURE &2 TO <fvalue>.
<fvalue> = &3.
END-OF-DEFINITION.
it_table = VALUE #( ( ) ( ) ( ) ).
LOOP AT it_table ASSIGNING FIELD-SYMBOL(<fs_tab>).
put_values 'yesterday' <fs_tab> 'Result Yesterday'.
put_values 'today' <fs_tab> 'Result Today'.
put_values 'tomorrow' <fs_tab> 'Result Tomorrow'.
ENDLOOP.
This will work if the number if the loop iterations are equal to lines of itab (as in your code).

SAP SLT into HANA not updating date field

I would like to SLT data into our HANA Data warehouse. That is the easy part, I can move data that is a one to one match (type 1 table). But I would like to make it type 2 and preserve history. I have the following code in the transform, and it will not populate the update field.
*&---------------------------------------------------------------------*
*& Include ZAUSP_SLT_TRANSFORM
*&---------------------------------------------------------------------*
STATICS lv_syn_name TYPE tabname.
DATA con_name TYPE dbcon_name.
DATA lv_timestamp TYPE timestampl.
FIELD-SYMBOLS <lv_operation> TYPE any.
CONCATENATE _mt_id ':R:R' INTO con_name.
ASSIGN COMPONENT 'IUUC_OPERAT_FLAG' OF STRUCTURE <wa_s_AUSP> TO <lv_operation>.
IF sy-subrc = 0 AND
<lv_operation> = 'D'.
IF lv_syn_name IS INITIAL.
CALL METHOD cl_iuuc_tab_ident_access=>get_ident
EXPORTING
iv_mt_id = _mt_id
iv_tabname = _cobj_alias
iv_system_type = cl_iuuc_tab_ident_access=>co_system_receiver
iv_ident_type = cl_iuuc_tab_ident_access=>co_ident_synonym
IMPORTING
ev_full_name = lv_syn_name.
IF lv_syn_name IS INITIAL.
allog_msg 'E' 'DMC_RT_MSG' '000'
'Get Synonym Error' space space space 'IL '.
RAISE stopped_by_rule.
ENDIF.
ENDIF.
GET TIME STAMP FIELD lv_timestamp.
UPDATE (lv_syn_name) CLIENT SPECIFIED CONNECTION (con_name)
SET ZDELETE_FLAG = 'X'
ZUPD_DATETIME = lv_timestamp
WHERE mandt = <wa_s_AUSP>-mandt
AND objek = <wa_s_AUSP>-objek
AND atinn = <wa_s_AUSP>-atinn
AND atzhl = <wa_s_AUSP>-atzhl
AND mafid = <wa_s_AUSP>-mafid
AND klart = <wa_s_AUSP>-klart
AND adzhl = <wa_s_AUSP>-adzhl.
IF sy-subrc <> 0.
allog_msg 'E' 'DMC_RT_MSG' '000'
'Update Error' space space space 'IL '.
RAISE stopped_by_rule.
ENDIF.
skip_record.
ENDIF.
"Code for timestamp outside of delete.
IF lv_syn_name IS INITIAL.
CALL METHOD cl_iuuc_tab_ident_access=>get_ident
EXPORTING
iv_mt_id = _mt_id
iv_tabname = _cobj_alias
iv_system_type = cl_iuuc_tab_ident_access=>co_system_receiver
iv_ident_type = cl_iuuc_tab_ident_access=>co_ident_synonym
IMPORTING
ev_full_name = lv_syn_name.
IF lv_syn_name IS INITIAL.
allog_msg 'E' 'DMC_RT_MSG' '000'
'Get Synonym Error' space space space 'IL '.
RAISE stopped_by_rule.
ENDIF.
ENDIF.
GET TIME STAMP FIELD lv_timestamp.
UPDATE (lv_syn_name) CLIENT SPECIFIED CONNECTION (con_name)
SET ZUPD_DATETIME = lv_timestamp "slt_update is the name in your slt strucure!
WHERE MANDT = <wa_s_AUSP>-MANDT "key_1 = pk of your table
AND OBJEK = <wa_s_AUSP>-OBJEK
AND ATINN = <wa_s_AUSP>-ATINN
AND ATZHL = <wa_s_AUSP>-ATZHL
AND MAFID = <wa_s_AUSP>-MAFID
AND KLART = <wa_s_AUSP>-KLART
AND ADZHL = <wa_s_AUSP>-ADZHL.
IF sy-subrc <> 0.
allog_msg 'E' 'DMC_RT_MSG' '000'
'Update Error' space space space 'IL '.
RAISE stopped_by_rule.
ENDIF.
Why don't the time field get updated for all rows inserted into target? When I try and set a break point to debug during replication, I get the following error:
So I click one, and get the following for each one:
So I go to SE38 and try to activate each one individually:
I did not write the code in these additional programs, and do not understand how they relate to the INCLUDE I wrote. I am left thinking the INCLUDE transform I wrote is not being executed due to the background programs not being active?
The below code resolved my issue.
STATICS lv_syn_name TYPE tabname.
DATA con_name TYPE dbcon_name.
DATA lv_timestamp TYPE timestampl.
FIELD-SYMBOLS <lv_operation> TYPE any.
FIELD-SYMBOLS: <lt_log_tab> TYPE table,
<ls_log_tab> TYPE any,
<lv_primary_key_1> TYPE any,
<lv_primary_key_2> TYPE any,
<lv_primary_key_3> TYPE any,
<lv_primary_key_4> TYPE any.
*
*
*
** get operation flag
ASSIGN COMPONENT 'IUUC_OPERAT_FLAG' OF STRUCTURE <wa_s_ausp> TO <lv_operation>.
*
*
IF sy-subrc = 0 AND
<lv_operation> = 'D'.
*
*
**** replication mode and record was deleted
IF lv_syn_name IS INITIAL.
* get synonym name in case of multi use active
CALL METHOD cl_iuuc_tab_ident_access=>get_ident
EXPORTING
iv_mt_id = _mt_id
iv_tabname = _cobj_alias
* iv_tabname = 'AUSP'
iv_system_type = cl_iuuc_tab_ident_access=>co_system_receiver
iv_ident_type = cl_iuuc_tab_ident_access=>co_ident_synonym
IMPORTING
ev_full_name = lv_syn_name.
IF lv_syn_name IS INITIAL.
* set message
allog_msg 'E' 'DMC_RT_MSG' '000'
'Get Synonym Error' space space space 'IL '.
RAISE stopped_by_rule.
ENDIF.
ENDIF.
*
*
*
**** set additional target fields
GET TIME STAMP FIELD lv_timestamp.
CONCATENATE _mt_id ':R:R' INTO con_name.
UPDATE (lv_syn_name) CLIENT SPECIFIED CONNECTION (con_name)
SET deleted = 'X'
delete_time = lv_timestamp
WHERE mandt = <wa_s_ausp>-mandt
AND objek = <wa_s_ausp>-objek
AND atinn = <wa_s_ausp>-atinn
AND atzhl = <wa_s_ausp>-atzhl
AND mafid = <wa_s_ausp>-mafid
AND klart = <wa_s_ausp>-klart
AND adzhl = <wa_s_ausp>-adzhl.
IF sy-subrc <> 0.
DATA(lc_subrc) = sy-subrc.
DATA lc_ausp TYPE c LENGTH 100.
CONCATENATE <wa_s_ausp>-mandt <wa_s_ausp>-objek <wa_s_ausp>-atinn <wa_s_ausp>-atzhl <wa_s_ausp>-mafid <wa_s_ausp>-klart <wa_s_ausp>-adzhl
INTO lc_ausp SEPARATED BY ','.
* set message
allog_msg 'E' 'DMC_RT_MSG' '000'
'Update Error' space space space 'IL '.
allog_msg 'E' 'DMC_RT_MSG' '000'
'Error Details:' lv_syn_name _cobj_alias lc_subrc 'IL '.
allog_msg 'E' 'DMC_RT_MSG' '000'
'Table Details:' lc_ausp space space 'IL '.
RAISE stopped_by_rule.
ENDIF.
**** do not replicate delete
skip_record.
ELSEIF sy-subrc = 0 AND <lv_operation> = 'I'.
GET TIME STAMP FIELD <wa_r_ausp>-insert_time.
ELSEIF sy-subrc = 0 AND <lv_operation> = 'U'.
GET TIME STAMP FIELD <wa_r_ausp>-update_time.
ELSE.
*Initial load branch
GET TIME STAMP FIELD <wa_r_ausp>-insert_time.
ENDIF.

How to read the position value given the cost center

I want to read the position using this FM HRWPC_RPT_COSTCENTER_EVALPATH where the cost center is given.
There are 3 result tables. from which table I can read the position value ?
here how I call the FM:
DATA i_hrrootob TYPE TABLE OF hrrootob.
DATA w_hrrootob LIKE LINE OF i_hrrootob.
DATA i_object_tab TYPE TABLE OF objec.
DATA w_object_tab LIKE LINE OF i_object_tab.
data i_STRUC TYPE TABLE OF STRUC.
w_hrrootob-otype = 'K'.
w_hrrootob-objid = w_orgdata-costcenter_key-costcenter.
APPEND w_hrrootob TO i_hrrootob.
CALL FUNCTION 'HRWPC_RPT_COSTCENTER_EVALPATH'
EXPORTING
depth = 0
evpath = 'KOSTDIUP'
* PLVAR = 01
* BEGDA = SY-DATUM
* ENDDA = SY-DATUM
* LEVEL = 1
TABLES
root_objects = i_hrrootob
result_objec = i_object_tab
result_struc = i_STRUC
EXCEPTIONS
NO_OBJECTS_FOUND = 1
OTHERS = 2
.
I got it by myself.
The result table result_objec has the value in the field stext, where the obtype ='S'