Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Call function with select options problem

Former Member
0 Likes
941

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
865

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.

6 REPLIES 6
Read only

prasenjit_sharma
Active Contributor
0 Likes
865

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

Read only

Former Member
0 Likes
866

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.

Read only

0 Likes
865

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 ?

Read only

Former Member
0 Likes
865

...sorry, mistake

Read only

Former Member
0 Likes
865

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

Read only

0 Likes
865

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.