on 06-04-2009 5:18 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, you commented out your return table, so how do you know if it worked?
Rob
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.