on 09-20-2016 7:30 AM
Hello All ,
I want to read the transaction before save ,so I am calling crm_order_read FM in check_before_save .
But I am confused how to pass Header Guid in exporting parameter .
If possible please provide source code .
Regards ,
Rasika.
Hi Rasika
If I remember correctly the Parameter you're referring is an Internal Table.
So you'll need to pass the value from a Structure into the Table
DATA lv_guid | TYPE crmt_object_guid. |
DATA lt_header_guid | TYPE crmt_object_guid_tab. |
lv_guid = '123'. " Your Transaction GUID
INSERT lv_guid INTO TABLE lt_header_guid.
Regards
Arden
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arden ,
The below code I have written in check_before_save and I set the break point on FM .
But this is not working .
please help me .
DATA : ET_ORDERADM_H TYPE CRMT_ORDERADM_H_WRKT ,
ET_ORDERADM_I TYPE CRMT_ORDERADM_I_WRKT ,
guid TYPE CRMT_OBJECT_GUID_TAB ,
lv_guid TYPE crmt_object_guid .
lv_guid = iv_guid .
INSERT lv_guid INTO TABLE guid .
CALL FUNCTION 'CRM_ORDER_READ'
EXPORTING
IT_HEADER_GUID = guid
IMPORTING
ET_ORDERADM_H = ET_ORDERADM_H
ET_ORDERADM_I = eT_ORDERADM_I
* EXCEPTIONS
* DOCUMENT_NOT_FOUND = 1
* ERROR_OCCURRED = 2
* DOCUMENT_LOCKED = 3
* NO_CHANGE_AUTHORITY = 4
* NO_DISPLAY_AUTHORITY = 5
* NO_CHANGE_ALLOWED = 6
* OTHERS = 7
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
if eT_ORDERADM_I IS INITIAL .
MESSAGE : 'plz check data before saving prepare.........' TYPE 'I' .
ENDIF .
And Rasika do_not_save is an exception in CHECK_BEFORE_SAVE.
Only you have to write RAISE do_not_save if you do not want to save the current processing document.
if iv_error = 'X'.
RAISE do_not_save.
endif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rasika,
As I found your code is correct.
Can you check the value of sy-subrc after crm_order_read?
and if it is displaying message plz check data before saving prepare......... then please check if any Item is there in your order??
And r u sure badi implementation is active??
means badi implantation Runtime Behavior is Implementation will be called?
with regards,
Pramod Kumar Mandal.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
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.