02-26-2021 3:47 AM - edited 02-04-2024 12:49 AM
Hi all, How to set my custom Logic effective only in creation mode
here is my custom Logic
-----------------
* This method can be used to set values to sales document header extension fields.
* Example:
*
* First of all assign existing extension field values to output parameter:
* salesdocument_extension_out = salesdocument_extension_in.
*
* Then change further values:
* if salesdocument-salesdocumenttype = 'TA'.
* salesdocument_extension_out-yy1_field_sdh = 'ABC'.
* endif.
DATA result_tab TYPE match_result_tab.
FIND ALL OCCURRENCES OF regex '^450.*' IN salesdocument-PurchaseOrderByCustomer RESULTS result_tab.
IF result_tab IS NOT INITIAL.
SELECT SINGLE YY1_PO_DeliveryWay_PDH,YY1_PO_ShipName_PDH,YY1_PO_ShipContact_PDH,YY1_PO_ShipPhone_PDH,YY1_PO_ShipAddress_PDH,YY1_FPurExplanation_PDH,YY1_PSubContractBillNO_PDH,YY1_FCustomerID_PDH,YY1_PO_CustomerDate_PDH
INTO (@salesdocument_extension_out-yy1_deliveryway_sdh,@salesdocument_extension_out-yy1_shipcustomername_sdh,@salesdocument_extension_out-yy1_shipcustomercontac_sdh,
@salesdocument_extension_out-yy1_shipcustomerphone_sdh,@salesdocument_extension_out-yy1_shipcustomeraddres_sdh,@salesdocument_extension_out-yy1_fexplanation_sdh,
@salesdocument_extension_out-yy1_subcontractbillno_sdh,@salesdocument_extension_out-yy1_customerid_sdh,@salesdocument_extension_out-yy1_customerdate_sdh)
FROM I_PurchaseOrderAPI01
WHERE PurchaseOrder = @salesdocument-PurchaseOrderByCustomer.
endif.
--------------
I've know
DOCUMENTPROCESSINGMODE: Contains information on whether the document is currently in one of the following processing modes: CREATE, CHANGE, or DISPLAY
But I don't know how to add this to my custom Logic
Hi Tang,
If I understood your question correctly, you want check DOCUMENTPROCESSINGMODE in BAdI implementation. To my understanding, you can refer to coding below. Also, you can trace BAdI implementation by using 'Custom Logic Tracing' App.
Regards,
Hongbo
IF documentprocessingmode = 'CREATE'.
*Your logic here
Endif
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.