cancel
Showing results for 
Search instead for 
Did you mean: 

Passing values to FM

Former Member
0 Kudos

Hi Experts,

I have written the following code to assign partner2 to Partner1. But no result. Is there anything missing?

REPORT  ZCREATE_REL.

TABLES : BUT050 .

DATA: part1 TYPE but050-partner1,
      part2 TYPE but050-partner2.

DATA:
        BEGIN OF itab,
            part1 TYPE but050-partner1,
            part2 TYPE but050-partner2,
   END OF itab.

*Internal Table
DATA: i_itab TYPE TABLE OF itab WITH HEADER LINE.


*Workarea.
DATA: w_itab TYPE itab.

SELECTION-SCREEN BEGIN OF BLOCK blk18 WITH FRAME TITLE text-001.

SELECT-OPTIONS:
  s_part1 FOR part1 ,
  s_part2 FOR part2 .
SELECTION-SCREEN END OF BLOCK blk18.

Loop at i_itab into w_itab.

CALL FUNCTION 'BUPR_RELATIONSHIP_CREATE'
EXPORTING
iv_partner_1 = 'part1'
iv_partner_2 = 'part2'
iv_relationship = 'BUR011'
*iv_date_from = '00010101'
*iv_date_to = '99991231'
iv_testrun = ' '
iv_x_save = 'X'.
*TABLES
*et_return = gt_return.

*PERFORM disp_error USING gs_warning.
*COMMIT WORK AND WAIT.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
 EXPORTING
   WAIT          = 'X'.
* IMPORTING
*   RETURN        =
          .
endloop.

Thanks

Ajay

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

I do not see where i_itab gets populated. That itab is empty. Therefore the loop

never gets executed and the FM never called.

Regards

Greg Kern

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

The FM 'BUPR_RELATIONSHIP_CREATE' is not called at all, because there are no records in internal table ITAB.

Have you populated the records in ITAB. Please check.

Regards,

Prashant

venkat_o
Active Contributor
0 Kudos

Dear Ajay, 1. Inside LOOP-ENDLOOP statements are executed when i_itab has data. 2. As i_itab has part1 part2 fields, you should not hardcode like 'part1' w_tab-part1 when you passing values to BUPR_RELATIONSHIP_CREATE function module. 3. First fill the i_itab with partner values. I hope that you understand. Thanks Venkat.O

Former Member
0 Kudos

Hi Ajay,

Seems these are the following problems:

- the internal table itab is not having any data. The itab is not filled in the code any where so there is no data in it due to which function modules are not called.

- if you fill the internal table itab in your code then make sure that you are passing right values to the parameters iv_partner_1 and iv_partner_2.


CALL FUNCTION 'BUPR_RELATIONSHIP_CREATE'
EXPORTING
iv_partner_1 = 'part1'    "w_itab-partner1 or s_part1
iv_partner_2 = 'part2'    "w_itab-partner2 or s_part2
iv_relationship = 'BUR011'
*iv_date_from = '00010101'
*iv_date_to = '99991231'
iv_testrun = ' '
iv_x_save = 'X'. 

George

Former Member
0 Kudos

hi,

iv_partner_1 = 'part1'  " --> Should be wa_itab-part1
iv_partner_2 = 'part2' " --> Should be wa_itab-part2

Check whether you are passing the Partner numbers correctly ?

Please use where used list on FM before posting.

Former Member
0 Kudos

Well, you commented out your return table, so how do you know if it worked?

Rob

Former Member
0 Kudos

Hi Rob,

FM is working fine with a single value. But for Partner1 I wante to assign multiple Partner2s. That is the purpose. But Its not happening..

Thanks

Ajay