Hope you are doing good. We are having an issue where the DI_OPERATION_TYPE = 'X'. As I have aware that possible values would be I,D,B and U.
Case 1:
This is happing in some Initial full loads. Example Customer Attributes etc.
Case 2:
Also happening in some delta extracts. Example. GL Entries Balance.
What could be the cause of it?
Thanks in advance.
Related
As I know of, When you're using BAPI_GOODSMVT_CREATE at the same time(by loop or just coincidence), Using same material number puts you an error about locked object (Material XXXX is locked by USER YYYY).
But, as i know of, using BAPI_GOODSMVT_CREATE at the same time, but different material number WITH same production order makes no error.
Issue
Recently I found an error about M3/897 (Plant Data of Material XXXX is locked by user XXXX) when I'm doing BAPI_GOODSMVT_CREATE when I'm trying GI for Production order, by parallel processing, which are putting different Material number to same production order.
Question
So, I'm asking about constraint of BAPI_GOODSMVT_CREATE.
So far I know is -
A. You can't issue GI for Production Order(Mvt 261) at the same time, when you're putting same material number for different production order.
B. (I'm not sure about this) You can't issue GI for Production Order(Mvt 261) at the same time, when you're putting different material number for same production order.
Is both is right, or just A is right? Any help from experienced ABAPer or MM consultant would be appreciated!
To post GI in a loop you need to make commit after each run, and unlock the object explicitly, otherwise you will get the PP lock.
Try like this:
LOOP AT lt_orders ASSIGNING <fs>.
...
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = ls_header
goodsmvt_code = ls_code
IMPORTING
goodsmvt_headret = ls_headret
materialdocument = ls_retmtd
TABLES
goodsmvt_item = lt_item
return = lt_return.
IF line_exists( lt_return[ type = 'E' ] ).
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
COMMIT WORK AND WAIT.
CALL FUNCTION 'DEQUEUE_ALL'.
ENDIF.
ENDLOOP.
Always use BAPI_TRANSACTION_COMMIT with WAIT parameter or COMMIT WORK with the same after each BAPI call.
Also there can be tricky issues with the GR and implicit GI movements, see the note 369518 about this.
You can check the presence of existing lock at runtime using this FM - "ENQUE_READ2".
data: RAW_ENQ like LOCKSEDX_ENQ_TAB,
SUBRC type SY-SUBRC,
NUMBER type I.
clear : RAW_ENQ[], SUBRC, NUMBER.
add 1 to COUNTER.
call function 'ENQUE_READ2'
importing
SUBRC = SUBRC
NUMBER = NUMBER
tables
ENQ = RAW_ENQ.
But if you have to prevent a failure of GOODS mvt. in general you have instead to implement some reprocessing logic to store errors.
The steps would be : Catch errors --> store bapi information or header doc number --> retry later
I am trying to update a certain part of the code, where the code is shown below.
READ TABLE lt_cc_data ASSIGNING <ls_cc_data>
WITH KEY qmnum = ls_refferal-qmnum.
IF <ls_cc_data>-pruef is INITAL. *>>>>>Statement that I added
IF sy-subrc IS INITIAL.
<ls_cc_data>-pruef = <ls_ccicons>-icon_id.
ENDIF.
ENDIF.
Before entering the statement that I have shown in the code, the program would enter in each qnum = ls_refferal-qmnum and fill the pruef field, however it did not take into account the cases when the qnum had the same values throughout the table. What I try to did is filling the pruef field only in those cases when the field is empty.
Being that I cannot test it due to lack of data in the development system, is the logic behind my solution correct and if not can someone give me an similar solution?
Thank you all in advance!
EDIT
The code would look like this now:
READ TABLE lt_cc_data ASSIGNING <ls_cc_data>
WITH KEY qmnum = ls_refferal-qmnum.
IF <ls_cc_data>-pruef is INITAL. *>>>>>Statement that I added
<ls_cc_data>-pruef = <ls_ccicons>-icon_id.
ENDIF.
I have a case statement currently built but need to add an extra layer and I'm not sure of the most efficient and accurate way of doing it. I have these drug codes that are for SYRINGE usage, and another set of codes for PEN usage. I have those layers built in, easy enough. I am trying to add a third layer to determine if the member used both a pen and a syringe, so the member would have a code from both categories during my specified time period. Any ideas? Thanks in advance for the help!
, CASE WHEN NDC.GPI IN (
'2710400300D220',
'2710400300D233',
'2710400300D236',
'2710400400D220',
'2799100225D220',
'2799100235D220') THEN 'PEN'
WHEN NDC.GPI IN (
'27104004002022',
'27104010002005',
'27104020001805',
'27104070001820',
'2730001000E530') THEN 'SYRINGE'
ELSE 'OTHER' END AS DOSAGE_FORM
I already browse the web but i find no answer that can solve my problem.
I tried the concatenation of RBKP-BELNR and RBKP-GJAHR into BKPF-AWKEY to get the BKPF-BELNR then BKPF-BELNR to BSEG-BELNR, but always show no records.
I need to link to the RSEG to BSEG or RBKP to BSEG .
Need some help! thanks!
Edit: I made the parked document in Tcode MIR7
I found this, but can't enter to VBSEGS table.
UPDATE: these are the details I want to get. but can't find the other details
Concatenate BELNR & GJAHR from RSEG and pass it to the AWKEY field of BKPF table and you will get Accounting document number "BELNR", year "GJAHR" & Company Code "BUKRS". Pass these fields to BSEG and you will get the other details. Did you try it exactly this way? You should check your belnr has left padding '0' you can check it with double click on the record in SE16n tcode.
Actually, you can directly link these table.
Last option, If these are still not working for you, then you can link: However, it will kill the performance, I believe.
RSEG-EBELN = BSEG-EBELN
RSEG-EBELP = BSEG-EBELP
RSEG-MATNR = BSEG-MATNR
I think is this:
RSEG-LFBNR = BSEG-BELNR
RSEG-LFGJA = BSEG-GJAHR
RSEG-LFPOS = BSEG-BUZEI
I'm trying to replace some un-reliable sap scripting we have in place to do an MB01 from a custom goods receipt application. I have come across the .NET connector and it looks like it could do a job for me.
Research has churned up the BAPI called BAPI_GOODSMVT_CREATE but can anyone tell me what parameters might be required to perform this transaction?
I have access to a SAP test environment.
BAPI_GOODSMVT_CREATE accepts a table of values called GOODSMVT_ITEM which contains 121 fields. I'm sure that not all of these fields are required.
Ultimately I guess my question is, what how can I work out which ones are required?
Do you have access to a SAP system? I have recently used this BAPI, and it has quite detailed documentation. To view the documentation, use transaction SE37, and enter the BAPI name. Unfortunately I don't currently have access to a system.
You will have to ask one of your MM/Logistics people to tell you what the movement type (BWART) is, and depending on the config you will need details like material number (MATNR), plant (WERKS), storage location etc.
MB01 is a Post GR for PO transaction, it is an equivalent of GM_Code 01 in MIGO or BAPI_GOODSMVT_CREATE. MIGO transaction is a modern successor for obsolete MB01.
So, as per the BAPI_GOODSMVT_CREATE documentation for GM_Code 01 the following fields are mandatory:
Purchase order
Purchase order item
Movement type
Movement indicator
Quantity in unit of entry
ISO code unit of measurement for unit of entry or
quantity proposal
Here is the sample:
gmhead-pstng_date = sy-datum.
gmhead-doc_date = sy-datum.
gmhead-pr_uname = sy-uname.
gmcode-gm_code = '01'.
loop at pcitab.
itab-move_type = pcitab-mvt_type.
itab-mvt_ind = 'B'.
itab-plant = pcitab-plant.
itab-material = pcitab-material.
itab-entry_qnt = pcitab-qty.
itab-move_stloc = pcitab-recv_loc.
itab-stge_loc = pcitab-issue_loc.
itab-po_number = pcitab-pur_doc.
itab-po_item = pcitab-po_item.
concatenate pcitab-del_no pcitab-del_item into itab-item_text.
itab-move_reas = pcitab-scrap_reason.
append itab.
endloop.
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = gmhead
goodsmvt_code = gmcode
IMPORTING
goodsmvt_headret = mthead
tables
goodsmvt_item = itab
return = errmsg