2007 Aug 09 11:38 AM
Hi Gurus,
i need your help .....
here is my problem..
i added 4 z fields to the std table VBEP.
now i am trying to add/update values to those newly added fields through my program .
CALL FUNCTION 'SD_SALES_DOCUMENT_ENQUEUE'
EXPORTING
VBELN = SALESORDER
I_CHECK_SCENARIO_A = 'X'
I_VBAK = INT_VBAK
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
NO_CHANGE = 3
OTHERS = 4.
If any error occured
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
RETURN-TYPE = SY-MSGTY.
RETURN-ID = SY-MSGID.
RETURN-NUMBER = SY-MSGNO.
RETURN-MESSAGE = SY-MSGV1.
RETURN-MESSAGE_V1 = SY-MSGV2.
RETURN-MESSAGE_V2 = SY-MSGV3.
RETURN-MESSAGE_V3 = SY-MSGV4.
RESULT_CODE = 'E'.
RESULT_TEXT = 'Error is updating.'.
EXIT.
Successful
ELSEIF SY-SUBRC = 0.
Update VBEP
UPDATE VBEP
SET ZZARRIVAL_DATE = ARRIVAL_DATE
ZZARRIVAL_TIME = ARRIVAL_TIME
ZZLOADING_DATE = LOAD_DATE
ZZLOADING_TIME = LOAD_TIME
WHERE VBELN = SALESORDER
AND ETENR = WC_MAX_ETENR.
If successful set flag
IF SY-SUBRC = 0.
COMMIT WORK.
RESULT_CODE = 'I'.
RETURN-TYPE = 'I'.
RETURN-MESSAGE = 'Successful in updating table.'.
If unsuccessful set flag
ELSE.
RESULT_CODE = 'E'.
RETURN-TYPE = 'E'.
RETURN-MESSAGE = 'Update was terminated'.
ENDIF.
ENDIF.
but here i dont know what is the deque function module...
so because of that while i creating and accepting the order it sayd it is being edited by user...
if i comment the above code then it doesnt give ant error...
please help me in creating lock object to update or is thr any std lock objects exists...!!!
waiting for your valuable reply.
regards
sanjay
2007 Aug 09 11:49 AM
Hi,
Use the FM:DEQUEUE_ALL.
It will do the dequeue.
Thanks,
Sandeep.
Hi Gurus,
i need your help .....
here is my problem..
i added 4 z fields to the std table VBEP.
now i am trying to add/update values to those newly added fields through my program .
CALL FUNCTION 'SD_SALES_DOCUMENT_ENQUEUE'
EXPORTING
VBELN = SALESORDER
I_CHECK_SCENARIO_A = 'X'
I_VBAK = INT_VBAK
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
NO_CHANGE = 3
OTHERS = 4.
If any error occured
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
RETURN-TYPE = SY-MSGTY.
RETURN-ID = SY-MSGID.
RETURN-NUMBER = SY-MSGNO.
RETURN-MESSAGE = SY-MSGV1.
RETURN-MESSAGE_V1 = SY-MSGV2.
RETURN-MESSAGE_V2 = SY-MSGV3.
RETURN-MESSAGE_V3 = SY-MSGV4.
RESULT_CODE = 'E'.
RESULT_TEXT = 'Error is updating.'.
EXIT.
Successful
ELSEIF SY-SUBRC = 0.
Update VBEP
UPDATE VBEP
SET ZZARRIVAL_DATE = ARRIVAL_DATE
ZZARRIVAL_TIME = ARRIVAL_TIME
ZZLOADING_DATE = LOAD_DATE
ZZLOADING_TIME = LOAD_TIME
WHERE VBELN = SALESORDER
AND ETENR = WC_MAX_ETENR.
If successful set flag
IF SY-SUBRC = 0.
COMMIT WORK.
RESULT_CODE = 'I'.
RETURN-TYPE = 'I'.
RETURN-MESSAGE = 'Successful in updating table.'.
If unsuccessful set flag
ELSE.
RESULT_CODE = 'E'.
RETURN-TYPE = 'E'.
RETURN-MESSAGE = 'Update was terminated'.
ENDIF.
ENDIF.
but here i dont know what is the deque function module...
so because of that while i creating and accepting the order it sayd it is being edited by user...
if i comment the above code then it doesnt give ant error...
please help me in creating lock object to update or is thr any std lock objects exists...!!!
waiting for your valuable reply.
regards
sanjay
2007 Aug 09 11:48 AM
2007 Aug 09 11:49 AM
Hi,
Use the FM:DEQUEUE_ALL.
It will do the dequeue.
Thanks,
Sandeep.
2007 Aug 09 12:28 PM
Hi Sanjay,
This all depends upon the context of where your code is (stand-alone or within the SD userexits when processing sales orders).
The function you are using looks like a collective lock FM for different lock objects ENQUEUE_EVVBAKE and CSLEO_ENQUEUE. You could always call the individual DEQUEUE objects separately or perform a COMMIT WORK.
However, I am concerned over your statement 'so because of that while i creating and accepting the order it sayd it is being edited by user...' which sounds as though you are in userexit processing (could be mistaken).
If this is the case then you will need to modify the contents of XVBEP in something like USEREXIT_SAVE_DOCUMENT_PREPARE - no locking is required as the transaction you are in has the lock.
Hope this helps. If not then maybe provide more context to where your code is in the process.
BTW - I would also revisit your design as I personally would not want to directly update SAP tables
Thanks,
Pete
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |