07-03-2007 8:00 AM
Hallow
I doing that code(that return) but what is the best way to do it in <b>one</b> perform that all time I move difrent infty num.
IF <wa_lcl_pers_tab>-infty = '0000'.
LOOP AT infty_tab_after INTO ls_prelp.
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn "Convert: semi-transparent -> transparent infotype
EXPORTING
prelp = ls_prelp
IMPORTING
pnnnn = ls_p0000.
APPEND ls_p0000 TO lt_p0000.
ENDLOOP.
ENDIF.
IF <wa_lcl_pers_tab>-infty = '0001'.
LOOP AT infty_tab_after INTO ls_prelp.
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn "Convert: semi-transparent -> transparent infotype
EXPORTING
prelp = ls_prelp
IMPORTING
pnnnn = ls_p0001.
APPEND ls_p0001 TO lt_p0001.
ENDLOOP.
ENDIF.
IF <wa_lcl_pers_tab> = '0002'.
LOOP AT infty_tab_after INTO ls_prelp.
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn "Convert: semi-transparent -> transparent infotype
EXPORTING
prelp = ls_prelp
IMPORTING
pnnnn = ls_p0002.
APPEND ls_p0002 TO lt_p0002.
ENDLOOP.
ENDIF.
IF <wa_lcl_pers_tab> = '0006'.
LOOP AT infty_tab_after INTO ls_prelp.
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn "Convert: semi-transparent -> transparent infotype
EXPORTING
prelp = ls_prelp
IMPORTING
pnnnn = ls_p0006.
APPEND ls_p0006 TO lt_p0006.
07-03-2007 8:22 AM
u can use the below code
field-symbol: <fs_any> type any,
<fs_any2> type any.
data: l_field type string,
l_field2 type string.
IF <wa_lcl_pers_tab>-infty IN ( '0000' , '0001' , '0002' , '0003' , '0004' , '0005' ).
variable = <wa_lcl_pers_tab>-infty.
concatenate 'LS_P' variable into l_field .
concatenate 'LT_P' variable into l_field2.
assign (l_field) to <fs_any>.
assign (l_field) to <fs_any2>.
LOOP AT infty_tab_after INTO ls_prelp.
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn "Convert: semi-transparent -> transparent infotype
EXPORTING
prelp = ls_prelp
IMPORTING
pnnnn = <fs_any>..
APPEND <fs_any> TO <fs_any2>.
ENDLOOP.
ENDIF.
i hope it works.
Reward if useful
07-03-2007 8:08 AM
Hi,
try this: just loop at itab once like this
LOOP AT infty_tab_after INTO ls_prelp.
IF <wa_lcl_pers_tab>-infty = '0000'.
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn "Convert: semi-transparent -> transparent infotype
EXPORTING
prelp = ls_prelp
IMPORTING
pnnnn = ls_p0000.
APPEND ls_p0000 TO lt_p0000.
ENDIF.
IF <wa_lcl_pers_tab>-infty = '0001'.
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn "Convert: semi-transparent -> transparent infotype
EXPORTING
prelp = ls_prelp
IMPORTING
pnnnn = ls_p0001.
APPEND ls_p0001 TO lt_p0001.
ENDIF.
IF <wa_lcl_pers_tab> = '0002'.
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn "Convert: semi-transparent -> transparent infotype
EXPORTING
prelp = ls_prelp
IMPORTING
pnnnn = ls_p0002.
APPEND ls_p0002 TO lt_p0002.
ENDIF.
IF <wa_lcl_pers_tab> = '0006'.
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn "Convert: semi-transparent -> transparent infotype
EXPORTING
prelp = ls_prelp
IMPORTING
pnnnn = ls_p0006.
APPEND ls_p0006 TO lt_p0006.
endif.
endloop.
Jogdand M B
07-03-2007 8:10 AM
Hi Shanya,
Do something like
field symbol <fs>.
CASE <wa_lcl_pers_tab>-infty.
WHEN '0000'.
assign ls_p0000 to <fs>.
PERORM casting USING <fs> tables lt_p0000 infty_tab_after.
WHEN '0001'.
ENDCASE.
In the FORM define type as any.
Reward points if useful.
Regards,
Atish
07-03-2007 8:17 AM
07-03-2007 8:23 AM
In the FORM ENDFORM
FORM casting using p_fs
tables p_infty infty_tab_after.
LOOP AT infty_tab_after.
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
EXPORTING
prelp = ls_prelp
IMPORTING
pnnnn =p_fs.
APPEND p_fs TO p_infty
ENDLOOP.
ENDFORM.
Just correct all the syntax errors as I am just writing psuedo code.
Regards,
Atish
.
IF <wa_lcl_pers_tab>-infty = '0000'.
ENDIF.
07-03-2007 8:10 AM
Hi,
You can do it like this,
case <wa_lcl_pers_tab>-infty.
when '0000'
perform routine using ls_p0000 table lt_p0000.
when '0001'
perform routine using ls_p0001 table lt_p0000.
.
.
.
same for other cases
and in perform implemtation write
form routine using ls_p_common like ls_p001 table table lt_p_common ....
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn "Convert: semi-transparent -> transparent infotype
EXPORTING
prelp = ls_prelp
IMPORTING
pnnnn = ls_p_common .
APPEND ls_p_common TO lt_p_common.
endform
reward if useful.
07-03-2007 8:19 AM
Hi Shnya Tal,
Better you use that method if you want to write code for user-exit ZXPADU02.
for transaction PA30.
07-03-2007 8:22 AM
u can use the below code
field-symbol: <fs_any> type any,
<fs_any2> type any.
data: l_field type string,
l_field2 type string.
IF <wa_lcl_pers_tab>-infty IN ( '0000' , '0001' , '0002' , '0003' , '0004' , '0005' ).
variable = <wa_lcl_pers_tab>-infty.
concatenate 'LS_P' variable into l_field .
concatenate 'LT_P' variable into l_field2.
assign (l_field) to <fs_any>.
assign (l_field) to <fs_any2>.
LOOP AT infty_tab_after INTO ls_prelp.
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn "Convert: semi-transparent -> transparent infotype
EXPORTING
prelp = ls_prelp
IMPORTING
pnnnn = <fs_any>..
APPEND <fs_any> TO <fs_any2>.
ENDLOOP.
ENDIF.
i hope it works.
Reward if useful
07-03-2007 8:27 AM
Hi,
You can write like this
LOOP AT infty_tab_after INTO ls_prelp.
case <wa_lcl_pers_tab>-infty.
when '0000'.
perform f_test TABLES lt_p0000 USING ls_prelp ls_p0000.
when '0001'.
perform f_test TABLES lt_p0001 USING ls_prelp ls_p0001.
when ....
endcase.
ENDLOOP.
form f_test TABLES p_lt_p0000 type any USING p_ls_prelp p_ls_p0000.
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn "Convert: semi-transparent -> transparent infotype
EXPORTING
prelp = p_ls_prelp
IMPORTING
pnnnn = p_ls_p0000.
APPEND p_ls_p0000 TO p_lt_p0000.
endform.
Hope it helps u...
Regards,
Phani