Lock object funtion module for afpo table
Hii,
I have designed a screen and maintained batch field as mandatory field in that screen. and when i give batch number and hit enter the order number related to that batch number is automatcially picked. order and batch field's i am taking from AFPO table.now i want to lock this batch or order field so that no 2 user's can use same batch or order number while making entries.
can anyone let me know what is the function module i should use for enqueue and dequeue technics for these 2 fields.
Regards,
Venkat.
Edited by: venkat akella on Jun 29, 2010 1:40 PM
Hi Venkat,
For your requierment, you have to create a lock object for table AFPO using T code SE11.
The name of the Lock object should be start with EZ.
Then use the FM DEQUEUE_EZ**** & ENQUEUE_EZ**** For unlock and lock of the order.
Regards
DKS
Similar Messages
-
How to create ENQUEUE function module for s567 table
Hi Experts,
Anyone Plz tell the steps how to create a ENQUEUE function module for the table s567.
Its somewht urgent, plz help me.
<REMOVED BY MODERATOR>
Mohana
Edited by: Alvaro Tejada Galindo on Mar 10, 2008 4:21 PMHi,
You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.
Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.
Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.
Technicaly:
When you create a lock object System automatically creat two function module.
1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
You have to use these function module in your program.
Hope this will give a basic idea.
Regards
Sudheer -
How to find the function module for standard tables.
Hi
Could any one please tell me how to find the standard function module to update the standard tables
Thanks & Regards
SowmyaHi sowmya,
To find the function modules for standard tables you go for a where used list of that particular table and check only function module interfaces checkbox...
and more over you can go for DB_UPDATE_TABLE will be the function module for updating database table..
Hope this information would help you
Regards
Narin Nandivada -
Funtion module to 'Determine table and index size online' for DB400
hi ,
i am using the a custom program for getting the table details,
in this i am using the function module 'DB_TABLE_DATA_READ'.
This is working fine if the DataBase is ORACLE,
But not working for the database DB400,
Please Provide with the alternative function module or any other way
Regards,
KumarKumar,
in what "table details" are you interested? Maybe function module DB4_FILE_INFO could provide you with the information that you need. If you are primarily looking at table sizes, you can also try to query the tables DB4TABLE_STAT and DB4INDEX_STAT directly (in older SAP releases: DBSTATTDB4 and DBSTATIDB4). Please note that the function module and the table structures are no official interfaces, so they may change in future releases.
Kind regards,
Christian Bartels. -
Urgent: creation function module for chvw table
hi,
I want to make Function Module for the fields in which i have to display the production order and batch numbers.plzz tell me how to create for it.Hi Everybody,
About how to use this function Does anyone have an idea?
I've found it.
call function 'FI_DOCUMENT_READ'
exporting
i_awtyp = 'VBRK'
i_awref = vbfa_tab-vbeln
i_awsys = vbrk-logsys
i_bukrs = vbrk-bukrs
i_gjahr = vbrk-gjahr
tables
t_bkpf = xbkpf
t_bseg = xbseg
exceptions
wrong_input = 1
not_found = 2.
But this is not enough.
Best Regards Rasim. -
Function module for BSEG table
Hi Guru's,
SELECT bukrs
belnr
gjahr
budat
monat
waers
awkey
FROM bkpf
INTO TABLE i_bkpf_data
WHERE bukrs EQ pa_bukrs AND
budat IN so_budat.
SORT i_bkpf_data BY bukrs belnr gjahr.
IF i_bkpf_data[] IS NOT INITIAL.
SELECT bukrs belnr gjahr koart dmbtr wrbtr pswsl
kokrs kostl hkont aufnr lifnr ebeln buzei shkzg
FROM bseg
INTO TABLE i_bseg_data
FOR ALL ENTRIES IN i_bkpf_data
WHERE
bukrs EQ pa_bukrs AND
belnr EQ i_bkpf_data-belnr AND
gjahr EQ i_bkpf_data-gjahr AND
kostl IN so_kostl AND
lifnr IN so_lifnr AND
hkont IN so_hkont.
ENDIF.
I got performance issue on this Query..while accessing the data from BSEG table,its makes performance issue in my program so i want to improve performance of the program.i was analysed that BSEG table makes performance issue..
Hi..Anybody give the solution imporving this Query or give some function module for accessing BSEG table..
Note..I want to pass my selection inputs also into function module..i was seen some function module for BSEG,those are not satisfying the my inputs so those also making performance issue..
Regards
P.Senthil KumarHi Everybody,
About how to use this function Does anyone have an idea?
I've found it.
call function 'FI_DOCUMENT_READ'
exporting
i_awtyp = 'VBRK'
i_awref = vbfa_tab-vbeln
i_awsys = vbrk-logsys
i_bukrs = vbrk-bukrs
i_gjahr = vbrk-gjahr
tables
t_bkpf = xbkpf
t_bseg = xbseg
exceptions
wrong_input = 1
not_found = 2.
But this is not enough.
Best Regards Rasim. -
SAP Functional Module for authorization tables
I would like to know are there any standard SAP Functional Modules which could update the Authorization Tables, like AGR_1251.
Thank youHi Prabhu,
Other than function modules with role, I had also tried to look for function modules with AuthObject*.
Because, I would like to update remove one of the authorization object from the system. For example, remove all data which AUTHORIZATION OBJECT = S_SCD0 and ACTIVITY = 06 in the system.
I got the list of functions from the search, but all of them are without proper documentations. So is very hard for me to understand their functionalities and purposes.
Kindly advice.
Thank you. -
User-Exit/Badi/Funtion Module for update Batch in transaction CORK
Hi Gurus,
when an IDoc 'Z' is executed to do a confirmation using the FM CO_RU_ORDER_CONFIRMATION, the values of transaction CORK are modified.
I'd like to update the field batch number so when you enter a process order in transaction CORK and then you click on Components, you'll see the list of component and the batch number updated throught the custom IDoc.
Does anyone knows any user-exit or Badi or maybe a FM to implement so when the first confirmation is done, the batch numbers are updated?
Thanks in advance.Hi,
You can copy and paste the Report code below. This will give the list of User Exits and BADIs available for the Transcation code. Very usefull program.
Below code will give a list of BADIs for particular transaction.
=============START
*& Report ZNEGI16 *
REPORT ZNEGI16 .
TABLES : TSTC,
TADIR,
MODSAPT,
MODACT,
TRDIR,
TFDIR,
ENLFDIR,
SXS_ATTRT ,
TSTCT.
DATA : JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
DATA : FIELD1(30).
DATA : V_DEVCLASS LIKE TADIR-DEVCLASS.
PARAMETERS : P_TCODE LIKE TSTC-TCODE,
P_PGMNA LIKE TSTC-PGMNA .
DATA wa_tadir type tadir.
START-OF-SELECTION.
IF NOT P_TCODE IS INITIAL.
SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.
ELSEIF NOT P_PGMNA IS INITIAL.
TSTC-PGMNA = P_PGMNA.
ENDIF.
IF SY-SUBRC EQ 0.
SELECT SINGLE * FROM TADIR
WHERE PGMID = 'R3TR'
AND OBJECT = 'PROG'
AND OBJ_NAME = TSTC-PGMNA.
MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
IF SY-SUBRC NE 0.
SELECT SINGLE * FROM TRDIR
WHERE NAME = TSTC-PGMNA.
IF TRDIR-SUBC EQ 'F'.
SELECT SINGLE * FROM TFDIR
WHERE PNAME = TSTC-PGMNA.
SELECT SINGLE * FROM ENLFDIR
WHERE FUNCNAME = TFDIR-FUNCNAME.
SELECT SINGLE * FROM TADIR
WHERE PGMID = 'R3TR'
AND OBJECT = 'FUGR'
AND OBJ_NAME EQ ENLFDIR-AREA.
MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
ENDIF.
ENDIF.
SELECT * FROM TADIR INTO TABLE JTAB
WHERE PGMID = 'R3TR'
AND OBJECT in ('SMOD', 'SXSD')
AND DEVCLASS = V_DEVCLASS.
SELECT SINGLE * FROM TSTCT
WHERE SPRSL EQ SY-LANGU
AND TCODE EQ P_TCODE.
FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
WRITE:/(19) 'Transaction Code - ',
20(20) P_TCODE,
45(50) TSTCT-TTEXT.
SKIP.
IF NOT JTAB[] IS INITIAL.
WRITE:/(105) SY-ULINE.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
Sorting the internal Table
sort jtab by OBJECT.
data : wf_txt(60) type c,
wf_smod type i ,
wf_badi type i ,
wf_object2(30) type C.
clear : wf_smod, wf_badi , wf_object2.
Get the total SMOD.
LOOP AT JTAB into wa_tadir.
at first.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
WRITE:/1 SY-VLINE,
2 'Enhancement/ Business Add-in',
41 SY-VLINE ,
42 'Description',
105 SY-VLINE.
WRITE:/(105) SY-ULINE.
endat.
clear wf_txt.
at new object.
if wa_tadir-object = 'SMOD'.
wf_object2 = 'Enhancement' .
elseif wa_tadir-object = 'SXSD'.
wf_object2 = ' Business Add-in'.
endif.
FORMAT COLOR COL_GROUP INTENSIFIED ON.
WRITE:/1 SY-VLINE,
2 wf_object2,
105 SY-VLINE.
endat.
case wa_tadir-object.
when 'SMOD'.
wf_smod = wf_smod + 1.
SELECT SINGLE MODTEXT into wf_txt
FROM MODSAPT
WHERE SPRSL = SY-LANGU
AND NAME = wa_tadir-OBJ_NAME.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
when 'SXSD'.
For BADis
wf_badi = wf_badi + 1 .
select single TEXT into wf_txt
from SXS_ATTRT
where sprsl = sy-langu
and EXIT_NAME = wa_tadir-OBJ_NAME.
FORMAT COLOR COL_NORMAL INTENSIFIED ON.
endcase.
WRITE:/1 SY-VLINE,
2 wa_tadir-OBJ_NAME hotspot on,
41 SY-VLINE ,
42 wf_txt,
105 SY-VLINE.
AT END OF object.
write : /(105) sy-ULINE.
ENDAT.
ENDLOOP.
WRITE:/(105) SY-ULINE.
SKIP.
FORMAT COLOR COL_TOTAL INTENSIFIED ON.
WRITE:/ 'No.of Exits:' , wf_smod.
WRITE:/ 'No.of BADis:' , wf_badi.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(105) 'No userexits or BADis exist'.
ENDIF.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(105) 'Transaction does not exist'.
ENDIF.
AT LINE-SELECTION.
data : wf_object type tadir-object.
clear wf_object.
GET CURSOR FIELD FIELD1.
CHECK FIELD1(8) EQ 'WA_TADIR'.
read table jtab with key obj_name = sy-lisel+1(20).
move jtab-object to wf_object.
case wf_object.
when 'SMOD'.
SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
when 'SXSD'.
SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(20).
CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
endcase.
================END
<b>Reward POints if this helps.
Manish</b> -
How to use Generic Object Services(GOS) for each table control record.
Dear Expert,
I am using generic object services for document attachment but i am facing a problem while attaching document to a table control row. my requirement is to attach separate document for each and every row of table control but i am unable to attach document row wise of the table control.for each row GOS should display corresponding attached document not all the attached document.
Thanks in Advanced
Bhuwan Tiwari
Edited by: BHUWAN TIWARI on Feb 8, 2011 4:16 PM
Edited by: BHUWAN TIWARI on Feb 8, 2011 4:16 PMYou haven't explained what object and object key you're using, nor have you provided any indication of how you implemented the GOS attachment functionality. You need to provide more information to resolve an issue like this.
-
Function module for VBFA table
Hi Gurus,
Please Help me on this Issue..
I want to retrieve data from vbfa table..while making query to retrieve data from vbfa tabl,its making performance issue on production server.
SELECT vbelv
vbeln
INTO TABLE i_ref_data
FROM vbfa FOR ALL ENTRIES IN i_billing_main
WHERE
vbelv EQ i_billing_main-vbeln AND
vbtyp_n EQ c_vbtyp_n.
so i have tried to retrieve data using functiom module "RV_ORDER_FLOW_INFORMATION" .in this function i was not able to pass multiple document no to this function module so put this function module inside the loop but this option also making performance issue..
LOOP AT i_billing_main_temp INTO wa_billing_main.
CLEAR : wa_comwa,wa_vbfa.
REFRESH i_vbfa.
wa_comwa-vbeln = wa_billing_main-vbeln.
This function module used for retrieving document flow data from VBFA
CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
EXPORTING
comwa = wa_comwa
TABLES
vbfa_tab = i_vbfa.
SORT i_vbfa BY vbelv vbeln vbtyp_n.
DELETE ADJACENT DUPLICATES FROM i_vbfa COMPARING vbelv vbeln vbtyp_n.
SORT i_vbfa BY vbtyp_n.
READ TABLE i_vbfa
INTO wa_vbfa
WITH KEY vbtyp_n = c_vbtyp_n
BINARY SEARCH.
IF sy-subrc EQ 0.
wa_ref_data-vbeln = wa_vbfa-vbeln.
wa_ref_data-vbelv = wa_billing_main-vbeln.
APPEND wa_ref_data TO i_ref_data.
ENDIF.
ENDLOOP.
so kindly give me the solution for improving performance of this issue.
Is it having any function module to pass multiple inputs to the function module.?
Regards
P.Senthil Kumar
Edited by: senthil kumar on Mar 23, 2009 12:23 PMPlease add check condition to check internal table is blank.
if not i_billing_main[] is initial.
SELECT vbelv
vbeln
INTO TABLE i_ref_data
FROM vbfa FOR ALL ENTRIES IN i_billing_main
WHERE
vbelv EQ i_billing_main-vbeln AND
vbtyp_n EQ c_vbtyp_n.
endif.
This is the best possible way to retrive data from VBFA table.
Other method you adopted will take more time since you are calling the FM in loop.
Please check ST05 trace for your above query to see if primary index is being used. Else contact Basis to help you out. -
Funtion Module for user exits variables in BEx Queries.
Hi,
This is for BW Query customer exit variable (zvar2) for include ZXRSRU01 and exit :EXIT_SAPLRRS0_001.
Can anyone please suggest the function modules that can be used to do the following.
1)Read value of zvar1 from selection screen whatever
user enters at run time.
2)How to define the zvar2 in the include. zvar2 is the
variable created in BEx to be populated from this
customer exit.
3)How to use case statment where once the value for zvar1
is determined then,
Case zvar1.
when zvar1 = 0 , then zvar2 = 10
when zvar1 = 1 , then zvar2 = 20
3) Assign zvar2 value as computed in the case statement.
Can anyone please help with the code to achieve this.
Any information regarding function modules that can help write user exits for variable reading and input will be greatly helpful.
Thanks
Sarah.Hi Sarah,
You don't need any FM for your issue.
Please try thie sample code :
DATA: VAR_INPIUT LIKE RRRANGEEXIT.
CASE I_VNAM.
WHEN 'ZVAR2'.
CLEAR L_S_RANGE.
IF I_STEP = 2."PROCESSED AFTER VARIABLE INPUT
*Reading value of ZVAR1
LOOP AT I_T_VAR_RANGE INTO VAR_INPIUT
WHERE VNAM = 'ZVAR1'.
CASE VAR_INPIUT-LOW.
*FILLING ZVAR2
WHEN 0.
L_S_RANGE-LOW = 10.
WHEN 1.
L_S_RANGE-LOW = 20.
ENDCASE.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
EXIT.
ENDLOOP.
ENDIF.
ENDCASE.
Hope this helps
Joe -
Funtion Module for user exits for variables used in BEx Queries.
Hi,
This is for BW Query customer exit variable (zvar2) for include ZXRSRU01 and exit :EXIT_SAPLRRS0_001.
Can anyone please suggest the function modules that can be used to do the following.
1)Read value of zvar1 from selection screen whatever
user enters at run time.
2)How to define the zvar2 in the include. zvar2 is the
variable created in BEx to be populated from this
customer exit.
3)How to use case statment where once the value for zvar1
is determined then,
Case zvar1.
when zvar1 = 0 , then zvar2 = 10
when zvar1 = 1 , then zvar2 = 20
3) Assign zvar2 value as computed in the case statement.
Can anyone please help with the code to achieve this.
Any information regarding function modules that can help write user exits for variable reading and input will be greatly helpful.
Thanks
Sarah.Hi Sarah,
You don't need any FM for your issue.
Please try thie sample code :
DATA: VAR_INPIUT LIKE RRRANGEEXIT.
CASE I_VNAM.
WHEN 'ZVAR2'.
CLEAR L_S_RANGE.
IF I_STEP = 2."PROCESSED AFTER VARIABLE INPUT
*Reading value of ZVAR1
LOOP AT I_T_VAR_RANGE INTO VAR_INPIUT
WHERE VNAM = 'ZVAR1'.
CASE VAR_INPIUT-LOW.
*FILLING ZVAR2
WHEN 0.
L_S_RANGE-LOW = 10.
WHEN 1.
L_S_RANGE-LOW = 20.
ENDCASE.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
EXIT.
ENDLOOP.
ENDIF.
ENDCASE.
Hope this helps
Joe -
Funtional module for customer related details
Can anyone tell me is there any standard functional module that retrieves all details ( invoices,sales order,payments etc) based on particular customer. If not can anyone give me some ideas on creating this kind of functional module.
Thanks in advance.search some standard bapi's are there in bapi* in se37 and u find a lot of f.m u can use that.
Thanks and Regards,
Thirukumaran. R -
To find locks on the objects for the table-- urgent
hi all..
how to find which lock object is used for the table T001b...
i want to lock a record of the table t001b before righting the select query and then do some mofification and the unlock it again..
plz can any one tell me how to do this...
thnx
Message was edited by:
neha guptaHi Neha,
When you create a lock object System automatically creat two function module.
1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
You have to use these function module in your program.
check this link for example.
http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
tables:vbak.
call function 'ENQUEUE_EZLOCK3'
exporting
mode_vbak = 'E'
mandt = sy-mandt
vbeln = vbak-vbeln
X_VBELN = ' '
_SCOPE = '2'
_WAIT = ' '
_COLLECT = ' '
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
Thanks,
Reward If helpful. -
Lock Object (Not locking the table)
Hi Guys
I have a custom table ZDRAD same like standard table DRAD with an additional 'DATE' field . ZDRAD's Key fields are same like DRAD . I have created a lock object 'EZDRAD' where I put name = 'ZDRAD' (Custom table) and mode = 'EXCLUSIVE CUMULATIVE' . Now I want to lock the table(Whole table) before modifying/Inserting/deleting the records in se38. Please check the code below and suggest me if I am passing wrong values to the lock object Function module.
Code
TABLES : ZDRAD.
CALL FUNCTION 'ENQUEUE_EZDRAD'
EXPORTING
MODE_ZDRAD = 'E'
MANDT = SY-MANDT
DOKAR = ' '
DOKNR = ' '
DOKVR = ' '
DOKTL = ' '
DOKOB = ' '
OBZAE = 0
OBJKY = ' '
X_DOKAR = ' '
X_DOKNR = ' '
X_DOKVR = ' '
X_DOKTL = ' '
X_DOKOB = ' '
X_OBZAE = ' '
X_OBJKY = ' '
_SCOPE = '2'
_WAIT = 'X'
_COLLECT = ' '
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3
*IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.
IF SY-SUBRC = 0.
ZDRAD table is locked.
P_L_LOCK_STAT = 'X'.
EXIT.
ELSE.
ZDRAD table is not locked
CLEAR P_L_LOCK_STAT .
ENDIF.Hi Kanthimathi
That is numeric field . Please suggest me how can i check the lock.
Maybe you are looking for
-
I have CS2 and I use it almost every day.. Today when I tried to launch it, a prompt came up saying my Activation was no longer valid and it closed automatically. Then when I tried to re-open it, a prompt came up saying "A serious error has occured"
-
Xmonad - Can't start any terminal emulator (xterm,urxvt,etc)
Hi, I've recently installed Arch Linux in Virtualbox-OSE and also installed xmonad. It took me a while to get it running. It is all working fine and I can start all kinds of applications with MOD+Shift+P, but the only thing I can't do is start a term
-
Calling a BSP application from another
Hello, I have not a lot experince in bsp's programming. I am trying to call a bsp applicattion from another one. Do you know how can I do it?. Thanks in advance. Javier.
-
Hello, I have two code. One receive and execute command (the user doesn't touch this one) where many loops are running in a big while loop. The other write command and if I want to abort the execution I push the buttom abort. How can I return to the
-
My iPad suddenly started to show crazy colors. I turned it off. It would not reboot until I used the two-button reboot. Now it shows only green stripes. only for a few seconds and goes back to sleep. HELP!