Hello Experts,
I am using BAPI 'BAPI_PR_CREATE' to create PR in an Report . I am using bapi in an LOOP with below as such entries.
where Internal table LT_ITEM1 is referered to standard structure BAPIMEREQITEMIMP as below code.
IF LT_ITEM1[] IS NOT INITIAL .
CALL FUNCTION 'BAPI_PR_CREATE'
EXPORTING
PRHEADER = WA_HEADER2
PRHEADERX = WA_HEADERX2
* TESTRUN =
IMPORTING
NUMBER = WA_NUM2
* PRHEADEREXP =
TABLES
RETURN = T_RETURN2
PRITEM = LT_ITEM1
PRITEMX = LT_ITEMX1.
READ TABLE T_RETURN2 INTO WA_RETURN2 WITH KEY TYPE = 'S'.
IF SY-SUBRC = 0 .
CONCATENATE 'PR CREATED: ' WA_NUM2 INTO LV_OP2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
DELETE LT_FINAL WHERE SEL = 'X'.
MESSAGE LV_OP2 TYPE 'I'.
ELSE.
CONCATENATE 'Unable To Create PR' LV_MATNR2 INTO LV_MSG2.
MESSAGE LV_MSG2 TYPE 'I'.
ENDIF.
ENDIF.
Now the change is I need to create ONE PR for every change in fixed vendor, I mean ONE PR should be created for all cumilated Vendor line items
and entries which doesn't have vendor value One more PR should be created with no vendor.
My Problem is that I am not able to use AT New control break-statment ( as I thought for every change in fixed_vend field would fix my problem)
but I am not able to use the FIXED_VEND field is some where in 20th column from LEFT as it is standard structure, I am not able to chnage structure (I have brought to second column while debug just to make understand), any Key word suggested for such situation.
or I need to go with custom logic.
Help required.
Thanks in Advance.