Use of enque and deque function in BADI MB_DOCUMENT_BADI
Hi All,
I have implemented one implementation to the BADI MB_DOCUMENT_BADI.I have to use update command in this implementation to update on ZTABLE,In order to update I need to use enqueue and dequeue function before updating the table.
My concern is that in the documentation to the BADI it specifies that Unlocking the data( DEQUEUE_ALL) will be not used in this implementation.
Please let me know Can I use enqueue and deques function for this table to this BADI.
Thanks,.
Sandeep.
Hi,
I think field GOODSMVT_CODE is not table type, you mension it type table of 'BAPI2017_GM_CODE'.
Thanks,
Anmol.
Similar Messages
-
Hi all,
Can any one explain with example how to use Enque and Deque to lock a database table?this editable alv using this to make change in standard table.
*& Report ZALVF
REPORT ZALVF.
TYPE-POOLS *
TYPE-POOLS: SLIS.
INTERNAL TABLES/WORK AREAS/VARIABLES *
DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
I_INDEX TYPE STANDARD TABLE OF I WITH HEADER LINE,
W_FIELD TYPE SLIS_FIELDCAT_ALV,
P_TABLE LIKE DD02L-TABNAME,
DY_TABLE TYPE REF TO DATA,
DY_TAB TYPE REF TO DATA,
DY_LINE TYPE REF TO DATA.
FIELD-SYMBOLS *
FIELD-SYMBOLS: <DYN_TABLE> TYPE STANDARD TABLE,
<DYN_WA> TYPE ANY,
<DYN_FIELD> TYPE ANY,
<DYN_TAB_TEMP> TYPE STANDARD TABLE.
SELECTION SCREEN *
PARAMETERS: TABNAME(30) TYPE C,
LINES(100) TYPE N.
START-OF-SELECTION *
START-OF-SELECTION.
Storing table name
P_TABLE = TABNAME.
Create internal table dynamically with the stucture of table name
entered in the selection screen
CREATE DATA DY_TABLE TYPE STANDARD TABLE OF (P_TABLE).
ASSIGN DY_TABLE->* TO <DYN_TABLE>.
IF SY-SUBRC <> 0.
MESSAGE I000(Z_ZZZ_CA_MESSAGES) WITH ' No table found'.
LEAVE TO LIST-PROCESSING.
ENDIF.
Create workarea for the table
CREATE DATA DY_LINE LIKE LINE OF <DYN_TABLE>.
ASSIGN DY_LINE->* TO <DYN_WA>.
Create another temp. table
CREATE DATA DY_TAB TYPE STANDARD TABLE OF (P_TABLE).
ASSIGN DY_TAB->* TO <DYN_TAB_TEMP>.
SORT I_FIELDCAT BY COL_POS.
Select data from table
SELECT * FROM (P_TABLE)
INTO TABLE <DYN_TABLE>
UP TO LINES ROWS.
REFRESH <DYN_TAB_TEMP>.
Display report
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_STRUCTURE_NAME = P_TABLE
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
TABLES
T_OUTTAB = <DYN_TABLE>
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
ENDIF.
*& Form SET_PF_STATUS
Setting custom PF-Status
-->RT_EXTAB Excluding table
FORM SET_PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'Z_STANDARD'.
ENDFORM. "SET_PF_STATUS
*& Form user_command
Handling custom function codes
-->R_UCOMM Function code value
-->RS_SELFIELD Info. of cursor position in ALV
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
Local data declaration
DATA: LI_TAB TYPE REF TO DATA,
L_LINE TYPE REF TO DATA.
Local field-symbols
FIELD-SYMBOLS:<L_TAB> TYPE TABLE,
<L_WA> TYPE ANY.
Create table
CREATE DATA LI_TAB TYPE STANDARD TABLE OF (P_TABLE).
ASSIGN LI_TAB->* TO <L_TAB>.
Create workarea
CREATE DATA L_LINE LIKE LINE OF <L_TAB>.
ASSIGN L_LINE->* TO <L_WA>.
CASE R_UCOMM.
When a record is selected
WHEN '&IC1'.
Read the selected record
READ TABLE <DYN_TABLE> ASSIGNING <DYN_WA> INDEX
RS_SELFIELD-TABINDEX.
IF SY-SUBRC = 0.
Store the record in an internal table
APPEND <DYN_WA> TO <L_TAB>.
Fetch the field catalog info
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = 'Z_DEMO_PDF_JG'
I_STRUCTURE_NAME = P_TABLE
CHANGING
CT_FIELDCAT = I_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
IF SY-SUBRC = 0.
Make all the fields input enabled except key fields
W_FIELD-INPUT = 'X'.
MODIFY I_FIELDCAT FROM W_FIELD TRANSPORTING INPUT
WHERE KEY IS INITIAL.
ENDIF.
Display the record for editing purpose
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_STRUCTURE_NAME = P_TABLE
IT_FIELDCAT = I_FIELDCAT
I_SCREEN_START_COLUMN = 10
I_SCREEN_START_LINE = 15
I_SCREEN_END_COLUMN = 200
I_SCREEN_END_LINE = 20
TABLES
T_OUTTAB = <L_TAB>
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC = 0.
Read the modified data
READ TABLE <L_TAB> INDEX 1 INTO <L_WA>.
If the record is changed then track its index no.
and populate it in an internal table for future
action
IF SY-SUBRC = 0 AND <DYN_WA> <> <L_WA>.
<DYN_WA> = <L_WA>.
I_INDEX = RS_SELFIELD-TABINDEX.
APPEND I_INDEX.
ENDIF.
ENDIF.
ENDIF.
When save button is pressed
WHEN 'SAVE'.
Sort the index table
SORT I_INDEX.
Delete all duplicate records
DELETE ADJACENT DUPLICATES FROM I_INDEX.
LOOP AT I_INDEX.
Find out the changes in the internal table
and populate these changes in another internal table
READ TABLE <DYN_TABLE> ASSIGNING <DYN_WA> INDEX I_INDEX.
IF SY-SUBRC = 0.
APPEND <DYN_WA> TO <DYN_TAB_TEMP>.
ENDIF.
ENDLOOP.
Lock the table
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
MODE_RSTABLE = 'E'
TABNAME = P_TABLE
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3.
IF SY-SUBRC = 0.
Modify the database table with these changes
MODIFY (P_TABLE) FROM TABLE <DYN_TAB_TEMP>.
REFRESH <DYN_TAB_TEMP>.
Unlock the table
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
MODE_RSTABLE = 'E'
TABNAME = P_TABLE.
ENDIF.
RS_SELFIELD-REFRESH = 'X'.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDFORM. "user_command -
In the numbers app, using the "date and time" function, is it possible to remove the time? I need to put together a list of dates, but I don't need or want times.
When formatting your column to date/time, pick Date & time, and then pick the letter i in the circle to the right. Then scroll down and pick "No time"
Jason -
What is the difference using start condition and check function module
what is the difference between using start condition and check function module
That's new to me, I thought a start condition was evaluated before the workflow started, and thus now workflow work item is available. That's why I think the only situation in which start conditions/check functions can't be used, is when the availability of a workflow log for investigation of exactly what stopped the workflow is a requirement.
I suppose the <a href="http://help.sap.com/saphelp_46c/helpdata/en/4c/86bf43feca11d2a64f0060087a79ea/frameset.htm">SAP documentation</a> is in need of an update. -
When I use the "Save and Quit" function it has no effect. The next time I open Firefox it goes to my home page only.
== This happened ==
Every time Firefox opened
== 3 days agoThis is not a solution, nor a work-around. The only thing this points out is where the problem lies. Settings are meant to be used in all sessions, barring exceptions and the fact that Firefox asks if you'd rather SAVE and then quit, makes it an exception. The user has elected to skip the clear browsing history step.
However, if the settings are permanently changed as you suggest, then the history will always be remembered for eternity when Firefox is closed. You then have to manually clear your history first at every session before closing.
Older versions of Firefox never behaved in such manner and recognized that the Save and Quit superseded the setting to Clear History. -
I am trying to do a simple copy and paste function while editing my website and I am getting an error message that says that my browser will not allow this function.. how can I override this?
thanks
Doug SnyderYou need to set Copy'n'Paste security policies for that domain in Firefox.
AllowClipboard Helper will help you do that. <br />
https://addons.mozilla.org/en-US/firefox/addon/allowclipboard-helper/ -
Need to Lock Planning Area by using Enque and Deque Technique.
Hi Experts,
My problem is I have to lock the planning area till the Batch program complete and I have to unlock the planning area once the batch job is completed. if any one of the user is login i.e. accessing planning book while batch job is running then batch job getting Failed.
we can check the lock in SM12
We have a custom program to send message to user to come out of the planning area but it does hit upto the mark.
we are expecting some solution to lock and unlock the plannig area till the job completes.
I was using some functional module to lock the planning area but it does not helped us. Kindly provide some help to acheive this situation
The below functional modules I used to lock the Plannning area ZDP31. I have given the input while executing the Function module PAREAID = ZDP31 (our Planning area Name)
1) ENQUEUE_/SAPAPO/E_PAREA
2) /SAPAPO/TS_DM_LOCK
3) /SAPAPO/TS_DM_UNLOCK_NEW
4) /SAPAPO/TS_DM_LOCK_UNLOCK
Please help me its in high prioity for us.Hello Balaji,
Here are the needful function modules where you can use to lock the PA by enque & deque technique..
a) ENQUEUE_READ Pass Planning Area value as GARG and PAREAID as GNAME to get information about lock entries for selected planning area. GUNAME corresponding to GNAME = /SAPAPO/DM_PAREA_LOCK and GOBJ = /SAPAPO/E_PAREA entries provides user id (s) locking the planning area displayed in the field GTARG.
b) TH_POPUP to send out popup messages to the users locking the Planning Area.
c) TH_DELETE_USER to kick off users (GUNAME) who have been locking the planning area.
I hope this helps...
Cheers !!
Regards
Rahul Chitte -
How to use ENQUE and DEQUE BAPI in Visual Composer
Hi All,
We are planning to update employee Address through Portal for that one we did one BAPI which supports ADDRESS Change of an employye, through Visual Composer we developed the application and we integrated into SAP Portal but we are not able to update our records, then we found BAPI_EMPLOYEE_ENQUE and BAPI_EMPLOYEE_DEQUE, but we don't know how to use thease BAPI's in Visual Composer i mean how to make connection between out input form and thease BAPI''s and our custom BAPI's.
If any one having this experience please let me know.
Thanks in Advance.
Thanks and Regards,
Abhi.Hi,
Nice to see your reply, we got this error in R/3 it self, when we are trying to excuting SAP Standard BAPI we are getting this error "Employee/applicant is not locked yet". I think this is bug from SAP itself, do you have any idea about this one? is there any settings we need to do in R/3 for resolving this one or else is there any data we need to maintaine for our Employee Records.
Please resolve my issue.
Thanks in Advance.
Thanks and Regards,
Abhi. -
Problems faced when using xsl:include and extension functions
I am Working in XML and XSLT using Oracle's XML Parser V2.
Previously i had worked in Microsoft technology using MSXMLParser.
I am facing some problems in XSLT. They are as below...
1. Using <xsl-include href="Somexsl.xsl">
the oraclexmlparser processor is giving the error : XSL-1002: Error while processing include XSL file (no protocol: Submenu.xsl).
* Can u tell me why i am getting this error, and what is the fix for this.
The same case with <xsl:import> too.
2. In case i have to write some functions in the previous WD of xsl i used these statements
<?xml version='1.0'?>
<!DOCTYPE PageRoot SYSTEM "../../Common/dtd/PageNavBar.dtd">
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/TR/WD-xsl"
xmlns:html="http://www.w3.org/TR/REC-html40"
result-ns="">
<xsl:script xmlns:xsl="uri:xsl"><![CDATA[
var strWebContentPath = "/SurSITE/Content/";
var strWebImagePath = "/SurSITE/sursitegraphics/";
function IncScript()
return "<script language='javascript' src='/SurSITE/Includes/avalidations.js'></script>";
]]>
</xsl:script>
To call the function i used this
<xsl:eval no-entities='true'> IncScript();</xsl:eval>
* Can u tell me how do i do this now, i tried with the code above using the current name space (<xsl:stylesheet version="1.1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" />)
Please use the example given above.
I will be very greatfull to u if u can give me some suggestion or help for the above said problems.
Thanking you and eagerly waiting for your reply(s).
nullThe current version is "1.0" not "1.1"
You haven't included the code for what your <xsl:include>
statement looks like, which seems to be what it's complaining
about...
XSLT 1.0 has no <xsl:eval>, this is a microsoft specific tag
from a pre-XSLT-1.0 version.
XSLT 1.0 has no <xsl:script> element either. -
How can I erase a job in SM35 using the job_open and job_close functions?
Hi!
I call and execute a job in the SM35 transaction with the functions below, but how can I erase the job from SM35. Because when the functions are executed in the JOB_CLOSE the variable jobrele return me an 'X' that means that the job is executed but I see that the job is not erased from the transaction.
Thanks for the help.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobgroup = bi
jobname = jname
IMPORTING
jobcount = jnumb
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 99.
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
authcknam = sy-uname
jobcount = jnumb
jobname = jname
REPORT = sy-repid
IMPORTING
STEP_NUMBER = v_step_number.
EXCEPTIONS
BAD_PRIPARAMS = 1
BAD_XPGFLAGS = 2
INVALID_JOBDATA = 3
JOBNAME_MISSING = 4
JOB_NOTEX = 5
JOB_SUBMIT_FAILED = 6
LOCK_FAILED = 7
PROGRAM_MISSING = 8
PROG_ABAP_AND_EXTPG_SET = 9
OTHERS = 10
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = jnumb
jobname = jname
strtimmed = 'X'
targetsystem = batchsys
IMPORTING
job_was_released = jobrele
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
no_release_privilege_given = 7
OTHERS = 99.hi
try this FM
<b>BP_JOB_DELETE</b>
the same FM is also called in
<b>
SCMA_DELETE_JOB</b>
plz reward if useful -
SQL query using Group by and Aggregate function
Hi All,
I need your help in writing an SQL query to achieve the following.
Scenario:
I have table with 3 Columns. There are 3 possible values for col3 - Success, Failure & Error.
Now I need a query which can give me the summary counts for distinct values of col3 for each GROUP BY of col1 and col2 values. When there are no values for col3 then it should return ZERO count.
Example Data:
Col1 Col2 Col3
abc 01 success
abc 02 success
abc 01 success
abc 01 Failure
abc 01 Error
abc 02 Failure
abc 03 Error
xyz 07 Failure
Required Output:
c1 c2 s_cnt F_cnt E_cnt (Heading)
abc 01 2 1 1
abc 02 1 1 0
abc 03 0 0 1
xyz 07 0 1 0
s_cnt = Success count; F_cnt = Failure count; E_cnt = Error count
Please note that the output should have 5 columns with col1, col2, group by (col1,col2)count(success), group by (col1,col2)count(failure), group by (col1,col2)count(error)
and where ever there are NO ROWS then it should return ZERO.
Thanks in advance.
Regards,
ShivaHi,
user13015050 wrote:
Thanks TTT. Unfortunately I cannot use this solution because I have huge data for this.T's solution is basically the same as mine. The first 23 lines just simulates your table. Since you actually have a table, you would start with T's line 24:
SELECT col1 c1, col2 c2, SUM(decode(col3, 'success', 1, 0)) s_cnt, ...
user13015050 wrote:Thanks a lot Frank. It helped me out. I just did some changes to this as below and have no issues.
SELECT col1
, col2
, COUNT ( CASE
WHEN col3 = 'SUCCESS'
THEN 1
END
) AS s_cnt
, COUNT ( CASE
WHEN col3 = 'FAILED'
THEN 1
END
) AS f_cnt
, COUNT ( CASE
WHEN col3 = 'ERROR'
THEN 1
END
) AS e_cnt
FROM t1
WHERE c2 in ('PURCHASE','REFUND')
and c4 between to_date('20091031000000','YYYYMMDDHH24MISS') AND to_date('20100131235959','YYYYMMDDHH24MISS')
GROUP BY c1, c2
ORDER BY c1, c2;
Please let me know if you see any issues in this query.It's very hard to read.
This site normally compresses spaces. Whenever you post formatted text (such as queries or results) on this site, type these 6 characters:
\(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.
Also, post exactly what you're using. The code above is SELECTing col1 and col2, but there's no mention of either in the GROUP BY clause, so I don't believe it's really what you're using.
Other than that, I don't see anything wrong or suspicious in the query. -
Unable to use "drag and drop function" from outlook
We are changing from Lotus to outlook and this has made a problem with getting pdf-files into OAWD directly .
Procedure was like this in Lotus
1. We get documents (FI, F-43, aso ) by email
2. We use OAWD function "drag and drop" , document is attached to a document type and workflow is triggered
3. We pick up documents from Business workplace , handle the document and send it to the approver (who earlier got it directly in their mailbox "lotus")
so far so good , everything worked well
Unfortunately we changed to outlook, non attached files can be "drag and dropped" into OAWD (I understand the part about outlook is showing links instead of "real" pdf and know this is part of the problem)
My question, it can not be possible that we have to manually save the documents/attached files from outlook into "desktop" to later use the drag and drop function?
I have read about the programms to solve problem , ex "inPuncto", but our experts says there will be problem with connector to workflow from OAWD.
I have my greatest doubts about that because this must be really two diffrent moduls, one for converting from outlook and the other must be unchange (undependent of the earlier procedure). SAP can not know from what program the documents will be dragged?
Suggestion about some OAWD-adaptor ?
Any suggestions about great solutions ?it seems there is no way.
See note 1797073
Is there someone with a better solution? -
How we will use these Job_open and Job_submit job_close??
Hi Experts,
i am new in Developement, i need one help here my problem is
I have one issue which is a report here i am getting the data into internal table, that data fetching i want to schedule it in background job..
can any body tell me how can i use the JOB_OPEN and JOB_SUBMIT function modules....
plz provide any example..
Thanks in Advance,
Venkat NHi,
Here is the sample program
*Submit report as job(i.e. in background)
data: jobname like tbtcjob-jobname value
' TRANSFER TRANSLATION'.
data: jobcount like tbtcjob-jobcount,
host like msxxlist-host.
data: begin of starttime.
include structure tbtcstrt.
data: end of starttime.
data: starttimeimmediate like btch0000-char1.
Job open
call function 'JOB_OPEN'
exporting
delanfrep = ' '
jobgroup = ' '
jobname = jobname
sdlstrtdt = sy-datum
sdlstrttm = sy-uzeit
importing
jobcount = jobcount
exceptions
cant_create_job = 01
invalid_job_data = 02
jobname_missing = 03.
if sy-subrc ne 0.
"error processing
endif.
Insert process into job
SUBMIT zreport and return
with p_param1 = 'value'
with p_param2 = 'value'
user sy-uname
via job jobname
number jobcount.
if sy-subrc > 0.
"error processing
endif.
Close job
starttime-sdlstrtdt = sy-datum + 1.
starttime-sdlstrttm = '220000'.
call function 'JOB_CLOSE'
exporting
event_id = starttime-eventid
event_param = starttime-eventparm
event_periodic = starttime-periodic
jobcount = jobcount
jobname = jobname
laststrtdt = starttime-laststrtdt
laststrttm = starttime-laststrttm
prddays = 1
prdhours = 0
prdmins = 0
prdmonths = 0
prdweeks = 0
sdlstrtdt = starttime-sdlstrtdt
sdlstrttm = starttime-sdlstrttm
strtimmed = starttimeimmediate
targetsystem = host
exceptions
cant_start_immediate = 01
invalid_startdate = 02
jobname_missing = 03
job_close_failed = 04
job_nosteps = 05
job_notex = 06
lock_failed = 07
others = 99.
if sy-subrc eq 0.
"error processing
endif.
Regards
Sudheer -
Copy and paste function not stable
i have problems using copy and paste function. the copied stuff SOMETIMES would not paste after i either Ctrl + C or right click to copy the stuff. does anyone here experience the same problem or have the solution? thanks in advance.
you might want to check whether you can copy the contents or not.. try to use the copy and paste function by right click the mouse to test..
-
Drag and Drop Functionality within the SAP Portal
Does anyone know if SAP Netweaver Portal 6.0 sp18 supports drag and drop technology. A good comparison would be Google where a user can drag iViews around and place them where they would like.
We are trying to build something similar to Google Gadgets with iViews and we would like our users to be able to add, remove, drag, and drop them in the Portal.
Has anyone done something similar to where I would be able to leverage them for further questions.
Any help is greatly appreciated. Thank you.
JasonHi
Were you able to find away of using the drag and drop functionality?
I am wanting to use a similar functionality to Yahoo where people can just drag the iViews they want into the page and saving their personalised settings. I am unable to find information as to what Portal release supports this functionality and how it works. Would you be able to help?
Many thanks
Jag
Maybe you are looking for
-
Cs3 applescript registration color
I'm having trouble setting a line of text to be [Registration] color from an applescript. No problem changing it to any other color - just registration.
-
I am getting a runtime error message when attempting to install iTunes.
When attempting to install iTunes I keep getting a Runtime Error! message under the Microsoft Visual C++ Runtime Library. Anyone have this same issue and an idea on how to remedy?
-
How to get difference in days between 2 dates excluding weekends
Hi all, i have a requirement, to calculate the difference between 2 dates, in days. eg: 01/08/2007 and 05/08/2007. Difference = 4 days. But here my actual requirement is i have to calculate this difference excluding weekends (saturday n sundays)
-
Certain artists' music mysteriously deleted from Macbook
Please help, and don't just tell me to Google it, because I did and I couldn't find anything helpful. So, I don't listen to my iTunes library that much. It's probably been a few months, so I can't be entirely sure when this happened. But I just tried
-
IPod shuffle mojado y botones no funcionan??
Hola, veran mi ipod shuffle cuarta generacion se mojo y cuando lo prendo se escucha la cancion pero inmediatamente se bloquea y ya no se desbloquea.... porfavor ayuda!!!