on 10-07-2007 2:20 PM
hi all,
i am creating a rule using a function module
can any one send sample coding to create a function module for a rule,
and also how to pass values for function module to rule container..
thanks in advance.
Hi,
Check this FM code,
TABLES: MARC.
INCLUDE <CNTAIN>.
DATA : LT_HOLDERS TYPE STANDARD TABLE OF SWHACTOR WITH HEADER LINE,
LT_CONTAINER TYPE STANDARD TABLE OF SWCONT WITH HEADER LINE.
DATA : PLANT LIKE MARC-WERKS,
MATNR LIKE MARC-MATNR.
SWC_GET_ELEMENT AC_CONTAINER 'FIRST' MATNR.
SELECT SINGLE WERKS FROM MARC INTO PLANT WHERE MATNR = MATNR.
BREAK-POINT.
*LOOP AT LT_HOLDERS.
IF PLANT EQ 1000.
LT_HOLDERS-OTYPE = 'O '.
LT_HOLDERS-OBJID = '50003399'.
ELSE.
LT_HOLDERS-OTYPE = 'O '.
LT_HOLDERS-OBJID = '50003406'.
ENDIF.
*ENDLOOP.
APPEND LT_HOLDERS TO ACTOR_TAB.
SWC_SET_ELEMENT LT_CONTAINER 'OTYPE' LT_HOLDERS-OTYPE.
SWC_SET_ELEMENT LT_CONTAINER 'OBJID' LT_HOLDERS-OBJID.
ENDFUNCTION.
Table Parameters :
AC_CONTAINER LIKE SWCONT
ACTOR_TAB LIKE SWHACTOR
Activate the FM and then go to PFAC.
Give the FM anme and create one Container "First".
Thanks,
Reward If Helpful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Follow as Rule 168
Thanks and Regards,
Prabhakar Dharmala
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.