‎2010 Feb 03 4:45 PM
Hi there dear SDN community members.
I have got an strange ABAP problem wich function call.
Code1
CLEAR ls_selec .
ls_selec-iobjnm = '9AMATNR' .
ls_selec-sign = 'I' .
ls_selec-option = 'EQ' .
ls_selec-low = '0000000000000000000000000000000000017714' .
APPEND ls_selec TO lt_selec .
CLEAR ls_selec .
ls_selec-iobjnm = '9AMATNR' .
ls_selec-sign = 'I' .
ls_selec-option = 'EQ' .
ls_selec-low = '0000000000000000000000000000000010079409' .
APPEND ls_selec TO lt_selec .
CALL FUNCTION '/SAPAPO/TS_PLOB_LIST_GET'
EXPORTING
iv_bas_plobid = 'Z_DP_POS'
it_selection = lt_selec
it_group_by = lt_group
IMPORTING
et_plob_values = lt_plobs .
Function returns data in lt_plobs itab only for the last product which was appended to the selection table lt_selec.
Whilst
Code2
CLEAR ls_selec .
ls_selec-iobjnm = '9AMATNR' .
ls_selec-sign = 'I' .
ls_selec-option = 'BT' .
ls_selec-low = '0000000000000000000000000000000000017714' .
ls_selec-high = '0000000000000000000000000000000010079409' .
APPEND ls_selec TO lt_selec .
Returns data in lt_plobs for all products included in selection tab lt_selec.
What am I doing wrong in case of Code1? Why function does not return data for both products included in selection tab lt_selec?
Will be thankful for help. Regards. P.
‎2010 Feb 03 6:14 PM
Use the code as described below to solve your issue.
Loop at it_selec.
CALL FUNCTION '/SAPAPO/TS_PLOB_LIST_GET'
EXPORTING
iv_bas_plobid = 'Z_DP_POS'
it_selection = lt_selec
it_group_by = lt_group
IMPORTING
et_plob_values = lt_plobs .
<<<add your desired logic>>>>
endloop.
‎2010 Feb 03 6:03 PM
Hi,
Looks like if you and multiple rows in the selection table it takes the last one. You can get into the function module /SAPAPO/TS_PLOB_LIST_GET and check where the field it_selection is being used. Also this one is an importing parameter for the FM not a tables parameter so I doubt this could be the reason as well.
Could you also check any documentation of this FM?
Regards
Prasenjit
‎2010 Feb 03 6:14 PM
Use the code as described below to solve your issue.
Loop at it_selec.
CALL FUNCTION '/SAPAPO/TS_PLOB_LIST_GET'
EXPORTING
iv_bas_plobid = 'Z_DP_POS'
it_selection = lt_selec
it_group_by = lt_group
IMPORTING
et_plob_values = lt_plobs .
<<<add your desired logic>>>>
endloop.
‎2010 Feb 03 6:22 PM
I think its a table type because the signature parameter is prefixed with 'IT'.
@OP: Did you debug and check what is the value filled in the range table when the fm is getting called ?
‎2010 Feb 03 6:51 PM
‎2010 Feb 03 6:54 PM
hello,
did you try this?
CALL FUNCTION '/SAPAPO/TS_PLOB_LIST_GET'
EXPORTING
iv_bas_plobid = 'Z_DP_POS'
it_selection = lt_selec[]
it_group_by = lt_group
IMPORTING
et_plob_values = lt_plobs .
regards,darek
‎2010 Feb 04 9:25 AM
I am very sorry to take your time unnecessarily.
The problem was caused by data inconsistency in our sandbox system I was developing in.
Be understanding, please.
Kind regards. P.
Ps.
Vinod Nair
The 'Loop' solution has slowed the performance down very much.