07-18-2011 2:06 PM
Actually I have created a program to populate a field, SITE ID (VBKD-IHREZ) from Sales Order into Purchase Requisition(PR).
In PR, I have populated into EBAN-AFNAM by passing Sales order number on selection screen.
But i want to automize this program, In our case when sales order is created then PR is automatic generated. Please suggest me, When PR is generated then how can my program will be run automatic..
Regards,
Nitin Garg
07-19-2011 8:00 AM
Hello,
My understanding is that you've developed a report program and you want it to be run when the Sales Order is saved and populate the IHREZ field in the PR.
What you can do is, find a suitable user exit / enhancement point and call this report / Function module by passing the sales order number which will populate the required field in the PR.
Hope this helps.
Regards,
Venkata Phani Prasad K
07-19-2011 8:14 AM
Actually as off now, I m not working on User Exit or Enhancement..
Please give me brief for the same, how can i find a suitable userexit..
07-19-2011 10:04 AM
Hello,
Here is the procedure that you can follow.
1. Go to Transaction SMOD.
2. Press F4. You'll find some enhancements.
3. Click on the button Information System.
4. Type the Package name as VA (because we are looking for Enhancements for Sales Order) and press enter.
5. You will find all the relevent enhancements for sales order processing in which you'll also find the enhancement V45E0001.
6. Go to CMOD and create a Z-project for the same enhancement and make sure to activate the enhancement.
7. In that enhancement, you'll find a customer function EXIT_SAPFV45E_001 in which you'll find the include ZXVVAU15.
8. Double click on the include and save it on a transport.
9. Write you code / call the report / function module to populate the PR data from the Sales Order by using appropriate
parameters of that function module.
The above procedure is generic for finding any enhancement / user exit / custom function for any module if the package is known.
Hope this helps.
Regards,
Venkata Phani Prasad K
07-20-2011 12:12 PM
Dear,
I would like to share you my code, from which i can populate site id from sales Order(TELECOM) into PR.
But i am unable to get automize this code. Please give me suitable solution..
LOOP AT it_final INTO wa_final.
IF wa_final IS NOT INITIAL.
CALL FUNCTION 'ENQUEUE_EZ_EBAN'
EXPORTING
mode_eban = 'X'
mandt = sy-mandt
* BANFN =
* BNFPO =
* X_BANFN = ' '
* X_BNFPO = ' '
* _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.
ELSEIF sy-subrc = 0.
UPDATE eban CLIENT SPECIFIED SET afnam = wa_final-ihrez WHERE banfn = wa_final-banfn AND bnfpo = wa_final-bnfpo.
IF sy-subrc = 0.
counter = counter + 1.
ELSEIF sy-subrc <> 0.
error = error + 1.
ENDIF.
CALL FUNCTION 'DEQUEUE_EZ_EBAN'
EXPORTING
mode_eban = 'X'
mandt = sy-mandt
* BANFN =
* BNFPO =
* X_BANFN = ' '
* X_BNFPO = ' '
* _SCOPE = '3'
* _SYNCHRON = ' '
* _COLLECT = ' '
.
ENDIF.
ENDIF.
CLEAR: wa_vbep,wa_vbkd,wa_final.
ENDLOOP.
<Added code tags>
Moderator Message: Post only relevant portions of your code & use code tags when pasting code
Edited by: Suhas Saha on Jul 20, 2011 4:57 PM
07-20-2011 12:45 PM
UPDATE eban CLIENT SPECIFIED SET ...
Never use direct updates on standard tables!
07-20-2011 2:22 PM
Dear Suhas Saha,
As you have more experience, Please suggest me for the same.
Regards,
Nitin Garg