Function Module ABAP
In SAP Abap which functional module is used to retrieve data from a table based on certain conditions?
Moderator message : Vague subject lines, question. Thread locked.
Edited by: Vinod Kumar on Jul 13, 2011 2:20 PM
"In SAP Abap which functional module is used to retrieve data from a table based on certain conditions?"
which table, what conditions, what data?SAP has n no of Function modules.You need to be more specific in your requirment.
Ask better questions for better answers.
Similar Messages
-
Hi Experts,
The following is the ABAP Code used in Function Module to extract Master Data from R/3 to BW.Could please convert that into human language (Explain logic of code)
FUNCTION MDEX_MATERIAL_MD .
""Lokale Schnittstelle:
*" IMPORTING
*" VALUE(I_REQUNR) TYPE SBIWA_S_INTERFACE-REQUNR OPTIONAL
*" VALUE(I_CHABASNM) TYPE SBIWA_S_INTERFACE-CHABASNM OPTIONAL
*" VALUE(I_MAXSIZE) TYPE SBIWA_S_INTERFACE-MAXSIZE OPTIONAL
*" VALUE(I_INITFLAG) TYPE SBIWA_S_INTERFACE-INITFLAG OPTIONAL
*" VALUE(I_UPDMODE) TYPE SBIWA_S_INTERFACE-UPDMODE OPTIONAL
*" VALUE(I_DATAPAKID) TYPE SBIWA_S_INTERFACE-DATAPAKID OPTIONAL
*" VALUE(I_S_TIMEINT) TYPE SBIWA_S_TIMEINT OPTIONAL
*" VALUE(I_RLOGSYS) TYPE SRSC_S_INTERFACE-RLOGSYS OPTIONAL
*" VALUE(I_PRIVATE_MODE) OPTIONAL
*" TABLES
*" I_T_SELECT TYPE SBIWA_T_SELECT OPTIONAL
*" I_T_FIELDS TYPE SBIWA_T_FIELDS OPTIONAL
*" E_T_BIW_MARA_S STRUCTURE BIW_MARA_S OPTIONAL
*" E_T_BIW_MARC_S STRUCTURE BIW_MARC_S OPTIONAL
*" E_T_BIW_MARD_S STRUCTURE BIW_MARD_S OPTIONAL
*" E_T_BIW_MVKE_S STRUCTURE BIW_MVKE_S OPTIONAL
*" E_T_BIW_MARM_S STRUCTURE BIW_MARM_S OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
function acts as a S-API-compatible interface for the SD-extractor
MATERIAL_DYNAM_DATA_SELECTION
STATICS: L_FIRST_CALL TYPE SBIWA_FLAG,
L_NO_SELECT TYPE C.
DATA: L_SUBRC TYPE SBIWM_SUBRC.
DATA: L_T_CHABASCMP LIKE RSSOSFIELD OCCURS 0 WITH HEADER LINE,
L_S_REQUEST TYPE RSAP_S_REQUEST,
L_SLOGSYS LIKE TBDLS-LOGSYS,
L_RODCHABGEN LIKE RODCHABGEN,
L_LINES TYPE I,
L_TX_SELECT TYPE SBIWA_TX_SELECT,
L_T_SELECT TYPE SBIWA_T_SELECT,
L_S_SELECT TYPE SBIWA_S_SELECT.
DATA: L_T_MARA LIKE MARA OCCURS 10 WITH HEADER LINE,
L_T_MARC LIKE MARC OCCURS 10 WITH HEADER LINE,
L_T_MARD LIKE MARD OCCURS 10 WITH HEADER LINE,
L_T_MVKE LIKE MVKE OCCURS 10 WITH HEADER LINE,
L_T_MARM LIKE MARM OCCURS 10 WITH HEADER LINE.
DATA: L_S_MATNR_MATERIAL_KEYS LIKE PRE03,
L_S_WERKS_MATERIAL_KEYS LIKE PRE01,
L_S_LGORT_MATERIAL_KEYS LIKE PRE08,
L_S_VTLIN_MATERIAL_KEYS LIKE PRE10.
Variable to read compound information "note383430 insED08052001
DATA: i_chabasnm_cmp TYPE sbiwa_s_interface-chabasnm.
"note383430 insED08052001
IF I_INITFLAG = 'X'.
Initialization: check input parameters
buffer input parameters
prepare data selection
Invalid second initialization call -> error exit
IF NOT G_FLAG_INTERFACE_INITIALIZED IS INITIAL.
IF 1 = 2. MESSAGE E008(R3). ENDIF.
LOG_WRITE 'E' "message type
'R3' "message class
'008' "message number
' ' "message variable 1
' '. "message variable 2
RAISE ERROR_PASSED_TO_MESS_HANDLER.
ELSE.
G_FLAG_INTERFACE_INITIALIZED = SBIWA_C_FLAG_ON.
ENDIF.
Check for supported update mode
CASE I_UPDMODE.
WHEN SBIWA_C_UPDMODE_FULL.
WHEN SBIWA_C_UPDMODE_DELTAINIT.
WHEN SBIWA_C_UPDMODE_DELTA.
WHEN OTHERS.
IF 1 = 2. MESSAGE E011(R3). ENDIF.
LOG_WRITE 'E' "message type
'R3' "message class
'011' "message number
I_UPDMODE "message variable 1
' '. "message variable 2
RAISE ERROR_PASSED_TO_MESS_HANDLER.
ENDCASE.
Initialize variable to read compound information
i_chabasnm_cmp = i_chabasnm. "note383430 insED08052001
**Check InfoObject validity and set IO-dependent parameters
G_TAB1_FLG = G_TAB2_FLG = G_TAB3_FLG = G_TAB4_FLG = ' '.
g_tab5_flg = ' '. "note417314 insED04072001
G_NO_MARM = 'X'.
CASE I_CHABASNM.
WHEN '0MATERIAL'.
G_TAB1_FLG = 'X'.
G_TABLENAME = 'MARA'.
WHEN '0ARTICLE'. "note383430 insED30042001
G_TAB1_FLG = 'X'. "note383430 insED30042001
G_TABLENAME = 'MARA'. "note383430 insED30042001
i_chabasnm_cmp = '0MATERIAL'. "note383430 insED08052001
WHEN '0ME_MATERIAL'. "note759687
G_TAB1_FLG = 'X'. "note759687
G_TABLENAME = 'MARA'. "note759687
i_chabasnm_cmp = '0MATERIAL'. "note759687
WHEN '0MAT_PLANT'.
G_TAB2_FLG = 'X'.
G_TABLENAME = 'MARC'.
WHEN '0ART_PLANT'. "note383430 insED30042001
G_TAB2_FLG = 'X'. "note383430 insED30042001
G_TABLENAME = 'MARC'. "note383430 insED30042001
i_chabasnm_cmp = '0MAT_PLANT'. "note383430 insED08052001
WHEN '0MAT_ST_LOC'.
G_TAB3_FLG = 'X'.
G_TABLENAME = 'MARD'.
WHEN '0ART_ST_LOC'. "note383430 insED30042001
G_TAB3_FLG = 'X'. "note383430 insED30042001
G_TABLENAME = 'MARD'. "note383430 insED30042001
i_chabasnm_cmp = '0MAT_ST_LOC'. "note383430 insED08052001
WHEN '0MAT_SALES'.
G_TAB4_FLG = 'X'.
G_TABLENAME = 'MVKE'.
when '0ART_SALES'. "note383430 insED30042001 "delED
g_tab4_flg = 'x'. "note383430 insED30042001 "delED
g_tablename = 'MVKE'. "note383430 insED30042001 "delED
WHEN '0ART_SALES'. "insED
G_TAB4_FLG = 'X'. "insED
G_TABLENAME = 'MVKE'. "insED
i_chabasnm_cmp = '0MAT_SALES'. "note383430 insED08052001
WHEN '0MAT_UNIT'.
G_TAB1_FLG = 'X'. "note417314 delED04072001
g_tab5_flg = 'X'. "note417314 insED04072001
G_TABLENAME = 'MARM'.
G_NO_MARM = ' '.
WHEN OTHERS.
IF 1 = 2. MESSAGE E009(R3). ENDIF.
LOG_WRITE 'E' "message type
'R3' "message class
'009' "message number
I_CHABASNM "message variable 1
' '. "message variable 2
RAISE ERROR_PASSED_TO_MESS_HANDLER.
ENDCASE.
** fill parameter buffer for data extraction calls
G_S_EXTR_IF-REQUNR = I_REQUNR.
G_S_EXTR_IF-CHABASNM = I_CHABASNM.
G_S_EXTR_IF-MAXSIZE = I_MAXSIZE.
G_S_EXTR_IF-INITFLAG = I_INITFLAG.
G_S_EXTR_IF-UPDMODE = I_UPDMODE.
G_S_EXTR_IF-DATAPAKID = I_DATAPAKID.
g_s_interface-read_opt =.
G_S_INTERFACE-MAX_MATNR = I_MAXSIZE.
g_s_interface-max_lifnr =.
g_s_interface-max_kunnr =.
g_s_interface-max_werks =.
CASE I_UPDMODE.
WHEN SBIWA_C_UPDMODE_DELTA.
** settings for delta data transfer
** get additional information about current extraction
CALL FUNCTION 'RSAN_LOGSYS_DETERMINE'
EXPORTING
I_CLIENT = SY-MANDT
IMPORTING
E_LOGSYS = L_SLOGSYS.
L_S_REQUEST-SNDPRN = L_SLOGSYS.
L_S_REQUEST-RCVPRN = I_RLOGSYS.
*----- Fill Content release so get_rodchabgen will work ok -
PERFORM GET_BWBCRL IN PROGRAM SAPLRSAP "OSS 1054070/2000
USING L_S_REQUEST-RCVPRN "OSS 1054070/2000
CHANGING L_SUBRC. "OSS 1054070/2000
PERFORM GET_RODCHABGEN IN PROGRAM SAPLRSAP
USING L_RODCHABGEN
I_CHABASNM
L_S_REQUEST.
** get base characteristic information
PERFORM DETERMINE_COMPOSITES IN PROGRAM SAPLRSAM
TABLES L_T_CHABASCMP
USING I_CHABASNM.
USING i_chabasnm_cmp. "note383430 insED08052001
** Get information about modified data objects
PERFORM FILL_MD_SELECT_ENTRYTABLE IN PROGRAM SAPLRSAP
TABLES L_T_CHABASCMP
USING L_RODCHABGEN-MSGTYP
I_CHABASNM
CHANGING L_TX_SELECT
L_SUBRC.
DESCRIBE TABLE L_TX_SELECT LINES L_LINES.
IF L_LINES = 0.
L_NO_SELECT = 'X'.
ENDIF.
** fill key-table for extractor
REFRESH G_T_MATNR_MATERIAL_KEYS.
REFRESH G_T_WERKS_MATERIAL_KEYS.
REFRESH G_T_LGORT_MATERIAL_KEYS.
REFRESH G_T_VTLIN_MATERIAL_KEYS.
refresh g_t_marm_material_keys. "note417314 insED04072001
LOOP AT L_TX_SELECT INTO L_T_SELECT.
CASE I_CHABASNM.
WHEN '0MATERIAL' OR '0ARTICLE' "note383430 insED30042001
OR '0ME_MATERIAL'.
READ TABLE L_T_SELECT
INTO L_S_SELECT
WITH KEY FIELDNM = 'MATNR'.
L_S_MATNR_MATERIAL_KEYS-MATNR = L_S_SELECT-LOW.
APPEND L_S_MATNR_MATERIAL_KEYS TO G_T_MATNR_MATERIAL_KEYS.
WHEN '0MAT_PLANT' OR '0ART_PLANT'. "note383430 insED30042001
READ TABLE L_T_SELECT
INTO L_S_SELECT
WITH KEY FIELDNM = 'MATNR'.
L_S_WERKS_MATERIAL_KEYS-MATNR = L_S_SELECT-LOW.
READ TABLE L_T_SELECT
INTO L_S_SELECT
WITH KEY FIELDNM = 'WERKS'.
L_S_WERKS_MATERIAL_KEYS-WERKS = L_S_SELECT-LOW.
APPEND L_S_WERKS_MATERIAL_KEYS TO G_T_WERKS_MATERIAL_KEYS.
WHEN '0MAT_ST_LOC' OR '0ART_ST_LOC'.
"note383430 insED30042001
READ TABLE L_T_SELECT
INTO L_S_SELECT
WITH KEY FIELDNM = 'MATNR'.
L_S_LGORT_MATERIAL_KEYS-MATNR = L_S_SELECT-LOW.
READ TABLE L_T_SELECT
INTO L_S_SELECT
WITH KEY FIELDNM = 'WERKS'.
L_S_LGORT_MATERIAL_KEYS-WERKS = L_S_SELECT-LOW.
READ TABLE L_T_SELECT
INTO L_S_SELECT
WITH KEY FIELDNM = 'LGORT'.
L_S_LGORT_MATERIAL_KEYS-LGORT = L_S_SELECT-LOW.
APPEND L_S_LGORT_MATERIAL_KEYS TO G_T_LGORT_MATERIAL_KEYS.
WHEN '0MAT_SALES' OR '0ART_SALES'. "note383430 insED30042001
READ TABLE L_T_SELECT
INTO L_S_SELECT
WITH KEY FIELDNM = 'MATNR'.
L_S_VTLIN_MATERIAL_KEYS-MATNR = L_S_SELECT-LOW.
READ TABLE L_T_SELECT
INTO L_S_SELECT
WITH KEY FIELDNM = 'VKORG'.
L_S_VTLIN_MATERIAL_KEYS-VKORG = L_S_SELECT-LOW.
READ TABLE L_T_SELECT
INTO L_S_SELECT
WITH KEY FIELDNM = 'VTWEG'.
L_S_VTLIN_MATERIAL_KEYS-VTWEG = L_S_SELECT-LOW.
APPEND L_S_VTLIN_MATERIAL_KEYS TO G_T_VTLIN_MATERIAL_KEYS.
ENDCASE.
ENDLOOP.
IF L_SUBRC <> 0.
IF 1 = 2. MESSAGE E009(R3). ENDIF.
LOG_WRITE 'E' "message type
'R3' "message class
'009' "message number
I_CHABASNM "message variable 1
' '. "message variable 2
RAISE ERROR_PASSED_TO_MESS_HANDLER.
EXIT.
ENDIF.
** settings for full data transfer or delta init.
*----- Selektionsbedingungen müssen immer übernommen werden -
WHEN sbiwa_c_updmode_full "DEL"TH090800
OR sbiwa_c_updmode_deltainit. "DEL"TH090800
REFRESH g_t_sel_table. "DEL"TH090800
LOOP AT i_t_select INTO l_s_select. "DEL"TH090800
g_s_sel_table-table = g_tablename. "DEL"TH090800
g_s_sel_table-field = l_s_select-fieldnm. "DEL"TH090800
MOVE-CORRESPONDING l_s_select TO g_s_sel_table. "DEL"TH090800
APPEND g_s_sel_table TO g_t_sel_table. "DEL"TH090800
ENDLOOP. "DEL"TH090800
WHEN OTHERS.
ENDCASE.
*----- Selektionsbedingungen müssen immer übernommen werden -
REFRESH G_T_SEL_TABLE. "INS"TH090800
LOOP AT I_T_SELECT INTO L_S_SELECT. "INS"TH090800
G_S_SEL_TABLE-TABLE = G_TABLENAME. "INS"TH090800
G_S_SEL_TABLE-FIELD = L_S_SELECT-FIELDNM. "INS"TH090800
MOVE-CORRESPONDING L_S_SELECT TO G_S_SEL_TABLE. "INS"TH090800
APPEND G_S_SEL_TABLE TO G_T_SEL_TABLE. "INS"TH090800
ENDLOOP. "INS"TH090800
REFRESH G_T_FIELDS.
APPEND LINES OF I_T_FIELDS TO G_T_FIELDS.
ELSE. "Initialization mode or data extraction ?
IF ( G_MORE_DATA_EXISTS = ' ' ) AND ( G_COUNTER_DATAPAKID NE 0 ).
RAISE NO_MORE_DATA.
EXIT.
ENDIF.
IF G_S_EXTR_IF-UPDMODE = SBIWA_C_UPDMODE_DELTA.
IF NOT L_NO_SELECT IS INITIAL.
RAISE NO_MORE_DATA.
ENDIF.
ENDIF.
IF ( G_MORE_DATA_EXISTS = 'X' ) OR ( G_COUNTER_DATAPAKID = 0 ).
REFRESH L_T_MARA.
REFRESH L_T_MARC.
REFRESH L_T_MARD.
REFRESH L_T_MVKE.
REFRESH L_T_MARM.
CALL FUNCTION 'MATERIAL_DYNAM_DATA_SELECTION'
EXPORTING
NO_MARM_DATA = G_NO_MARM
READ_MARA_DATA = G_TAB1_FLG
READ_MARC_DATA = G_TAB2_FLG
READ_MARD_DATA = G_TAB3_FLG
READ_MVKE_DATA = G_TAB4_FLG
read_marm_data = g_tab5_flg "note417314 insED04072001
JOIN_OPTION = 'O'
IN_MAX_MATNR = G_S_INTERFACE-MAX_MATNR
TABLES
IN_SELECT_FIELDS = G_T_SEL_TABLE
IN_MATNR_KEYS = G_T_MATNR_MATERIAL_KEYS
IN_WERKS_KEYS = G_T_WERKS_MATERIAL_KEYS
IN_VTLIN_KEYS = G_T_VTLIN_MATERIAL_KEYS
IN_LGORT_KEYS = G_T_LGORT_MATERIAL_KEYS "insED22032001
in_marm_keys = g_t_marm_material_keys "note417314
"insED04072001
OUT_MARA_TAB = L_T_MARA
OUT_MARC_TAB = L_T_MARC
OUT_MARD_TAB = L_T_MARD
OUT_MVKE_TAB = L_T_MVKE
OUT_MARM_TAB = L_T_MARM
CHANGING
MORE_DATA_EXISTS = G_MORE_DATA_EXISTS
EXCEPTIONS
WRONG_INPUT_DATA = 1
OTHERS = 2
IF SY-SUBRC <> 0.
IF 1 = 2. MESSAGE E011(R3). ENDIF.
LOG_WRITE 'E' "message type
'R3' "message class
'011' "message number
SY-SUBRC "message variable 1
' '. "message variable 2
RAISE ERROR_PASSED_TO_MESS_HANDLER.
ENDIF.
G_COUNTER_DATAPAKID = G_COUNTER_DATAPAKID + 1.
LOOP AT L_T_MARA.
MOVE-CORRESPONDING L_T_MARA TO E_T_BIW_MARA_S.
APPEND E_T_BIW_MARA_S.
ENDLOOP.
LOOP AT L_T_MARC.
MOVE-CORRESPONDING L_T_MARC TO E_T_BIW_MARC_S.
provide additional attributes not contained in MARC
PERFORM MARC_ADD_ATTRIBUTES CHANGING E_T_BIW_MARC_S
L_SUBRC.
IF L_SUBRC <> 0.
IF 1 = 2. MESSAGE E501(R§). ENDIF.
"insED03082001 begin note216922
log_write 'W' "message type
'R§' "message class
'501' "message number
e_t_biw_marc_s-werks "message variable 1
' '. "message variable 2
"insED03082001 end note216922
"delED03082001 begin note216922
LOG_WRITE 'E' "message type
'R§' "message class
'501' "message number
E_T_BIW_MARC_S-WERKS "message variable 1
' '. "message variable 2
RAISE ERROR_PASSED_TO_MESS_HANDLER.
"delED03082001 end note2169222
ENDIF.
APPEND E_T_BIW_MARC_S.
ENDLOOP.
LOOP AT L_T_MARD.
MOVE-CORRESPONDING L_T_MARD TO E_T_BIW_MARD_S.
APPEND E_T_BIW_MARD_S.
ENDLOOP.
LOOP AT L_T_MVKE.
MOVE-CORRESPONDING L_T_MVKE TO E_T_BIW_MVKE_S.
APPEND E_T_BIW_MVKE_S.
ENDLOOP.
LOOP AT L_T_MARM.
MOVE-CORRESPONDING L_T_MARM TO E_T_BIW_MARM_S.
APPEND E_T_BIW_MARM_S.
ENDLOOP.
ENDIF.
ENDIF.
ENDFUNCTION.
ThanksHi,
This might not be the right forum for this. You can post your question in more relevant forum like Netweaver-Exchange Infrastructure. -
Process Chain Review Question: function module/ABAP program/Event
Hi,
1. Can you tell me a bit more about function modules such as RSPC_CHAIN_ACTIVATE_REMOTE
2. What are function modules in general terms. i.e. What is their role?
3. How do I see all function module available?
4. When is function module used instead of ABAP program?
5. How do they help in the support and monitoring of Process Chains?
6. I am getting confused over the following under process chains job, event, function module and ABAP Program
Thanks2. What are function modules in general terms. i.e. What is their role?
Function module return a value ( most of the time), they return some value either a single value of rane of value or even a table. Example: FM to return fiscal period gieven the fiscal vaeiant and system date.
3. How do I see all function module available?
Go to Se37 and this is function builder. You will find FM starting with RS* more useful. You cna also create your own in Se37.
4. When is function module used instead of ABAP program?
In addtion to answer I gave in 3 above, program is used to check some logic and update some tables or give screen output.
You may note FM is also a program.
5. How do they help in the support and monitoring of Process Chains?
As I said, for monitoring chains, use Sm37 and logs in RSPC.
6. I am getting confused over the following under process chains job, event, function module and ABAP Program
I am not clear what are you looking for.
You cna schedule a FM or a program to run in a chain. Is that what you mean?
Ravi Thothadri -
Function module & Abap Program
Dear friends,
I have one value in 'RSPO_CHECK_DEVICE_PERMISSION'
function. how to use or import to abap program?
Regards,
SriniHi,
To Check the access permission for an output device
call function 'RSPO_CHECK_DEVICE_PERMISSION'
exporting
dest = itcpp-tddest
NAME =
exceptions
no_such_device = 1
no_permission = 2
others = 3.
if sy-subrc <> 0.
message e460 with dest_long_name.
endif.
Plzz reward points i fit helps. -
Call an ABAP program or a function module from command prompt/python script
Dear All,
I want to call a function module/ABAP program from command prompt or a python script.
Let me explain with an example.
There is a function module "z_add" that takes two integers as input parameters and generates their sum.
the sum is the output parameter.
Now i want to call this function module from command prompt / python script and pass parameters to this function module.
In return i must get the sum(i.e. the output of function module).
I tried using STARTRFC ,was able to call the FM but could not get the return value(output) from FM.
Can you please provide me the code of such a function module and the method to call it thereby passing parameters and getting the sum.
Thanks and regards,
Gaurav
Edited by: gauravkec2005 on Mar 4, 2010 7:41 AMthank you both! helpful answers! :o)
anyway!
i have written the program which is called from the SAPScript:
/: PERFORM GET_VATNUMBER IN PROGRAM ZFI_F140_OPERATIONS
/: USING &BKPF-BUKRS&
/: CHANGING &VATNUMBER&
CE VAT Registration No : &VATNUMBER&
REPORT zfi_f140_operations.
FORM get_vatnumber TABLES in_par STRUCTURE itcsy
out_par STRUCTURE itcsy.
DATA: lv_co_code TYPE bukrs,
lv_vat_no TYPE stceg.
READ TABLE in_par WITH KEY name = 'BKPF-BUKRS'.
MOVE in_par-value TO lv_co_code.
SELECT SINGLE stceg FROM t001
INTO lv_vat_no WHERE bukrs = lv_co_code.
out_par-name = 'VATNUMBER'.
WRITE lv_vat_no TO out_par-value.
CONDENSE out_par-value.
MODIFY out_par INDEX 1.
ENDFORM.
it is not working and i cannot work out why...
i have not been ABAPing for very long but have had a go....
any thoughts as to what i have done wrong?
or point me where i should be looking? thank you! -
Problem with calling a report from a function module. Please help! URGENT!
Hi Experts,
I have a scenarion like this:
XI -
> Function Module -
> ABAP Report
From XI I am callingf a function module in another R/3 system. This function module inturn calls a ABAP report using SUBMIT statement. The function module and the report reside in the same R/3 system.
I am calling the report like this:
SUBMIT yseg_save_bp_data WITH SELECTION-TABLE rspar
AND RETURN.
The problem is when I run the function module directly in the R/3 system then it calls the report without any problem.
On the other hand, when I call the function module from XI then the report is not called. On debug mode I found that the program exits just at the Submit statement. Why is this strange problem?
What mistake am I doing? Is there any limitations or restrictions with SUBMIT statement.
What is the correct way of using submit statement in this scenario?
Kindly help me!
Thanks
GopalHi Rao,
I have created the FM as remote RFC. Infact XI is able to call the FM. Only problem is when it reaches the point where the report is called via SUBMIT it exits.
Help me please!
Thanks
Gopal -
R/3 Master Data Extraction from Function Module
Hi Experts,
I need to extract R/3 Master Data (Attr & Text) using function Module.
It is already developed and in Live system,I need to extract Master Data for 3 more attributes.
Could you please specify detailed steps on how to proceed wit this once i made changes to Function Module (ABAP Code),Extract Structure...how shall i proceed once this is done.
ThanksHi,
Check the following,
http://help.sap.com/bp_biv235/BI_EN/html/bw.htm
business content
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/biw/g-i/how%20to%20co-pa%20extraction%203.0x
https://websmp203.sap-ag.de/co
http://help.sap.com/saphelp_nw04/helpdata/en/37/5fb13cd0500255e10000000a114084/frameset.htm
(navigate with expand left nodes)
also co-pa
http://help.sap.com/saphelp_nw04/helpdata/en/53/c1143c26b8bc00e10000000a114084/frameset.htm
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/fb07ab90-0201-0010-c489-d527d39cc0c6
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1910ab90-0201-0010-eea3-c4ac84080806
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ff61152b-0301-0010-849f-839fec3771f3
FI-CO 'Data Extraction -Line Item Level-FI-CO'
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/a7f2f294-0501-0010-11bb-80e0d67c3e4a
FI-GL
http://help.sap.com/saphelp_nw04/helpdata/en/c9/fe943b2bcbd11ee10000000a114084/frameset.htm
http://help.sap.com/saphelp_470/helpdata/en/e1/8e51341a06084de10000009b38f83b/frameset.htm
http://www.sapgenie.com/sapfunc/fi.htm
FI-SL
http://help.sap.com/saphelp_nw2004s/helpdata/en/28/5ccfbb45b01140a3b59298c267604f/frameset.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/41/65be27836d300ae10000000a114b54/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/ee/cd143c5db89b00e10000000a114084/frameset.htm
Please reward for the same. -
How to upload Excel file in BI using function module in abap program
How to upload Excel file in BI using function module in abap program?
Hi Anuj,
To upload the file , you can try a standard program "RSEPSFTP" .
while you execute the program , a selection screen appears in which the inputs should be give as
RFC destination - The target server name
FTP command- PUT
local file - your file name
local directory - path of your local file
remote file - your target file name
remote directory - where it has to be stored
Hope this is useful for you
Thanks & regards
Anju -
Call ABAP function module from script?
Hi,
I have an ABAP function module, which works fine when I call it in a transformation.
Since I don't need to execute this function for each record but rather for each file I process, I would like to move the call from the DataFlow to a script in the WorkFlow. When I click on the 'functions' button the ABAP FM is available in my SAP Datastore, so I drag and drop it into my script. I also make sure to populate all required variables.
There are no error messages or warning when I check my job definition.
When I execute it, I get the following RFC error:
Function call <xxx ( abcd ) > failed, due to error <150413>: <RFC CallReceive exception <FUNCTION_NOT_FOUND>.>.
Is it just not possible to call an RFC enabled function module in SAP from a script or am I doing something wrong here?
Thanks,
Jan.Could you please let me know how I can call an abap function module from a transformation? (from abap xslt program). I know how we can call methods of a class from the transformations, but no idea how we can call function modules. Any suggestions or a sample code snippet towards this will be very useful for me.
Thanks,
Shashi. -
How to create Inbound Idocs in a ABAP program? Any function Module?
Hello Experts,
My requirement is : I have sales order data which I extracted from third party system in my internal tables. In the same box I need to create inbound Idocs and then consequently create sales orders.
I have used the function module IDOC_INBOUND_WRITE_TO_DB to create inbound Idocs from Sales Orders data in internal tables. I have populated all the data records with correct PSGNUM and HLEVEL values. My plan is to create inbound idocs with this function module and send those to IDOC_INPUT_ORDERS function module which creates Sales Orders.
If a sales order in the internal table in ABAP program contains only one item, then I am getting correct idocs. But if more than one item exists for a sales order then the line item segments which got repeated in Idoc are having PSGNUM and HLEVEL values as zero when I checked in WE02. As a result the hierarchy from the second item segment is getting disturbed and getting the status 60.
I populated T_EDIDD with data records from IDOC_INBOUND_WRITE_TO_DB.
To the function module IDOC_INPUT_ORDERS, T_EDIDC and T_EDIDD are the input. I observed that in T_EDIDD also the PSGNUM and HLEVEL values are blank.
I am getting Status 60 with message 'EDI: Syntax error in IDoc (segment cannot be identified)' for idocs which have more than one item.
I need to extract sales data from third party and create inbound idocs and create sales orders in one ABAP program only. I need to display corresponding Idoc numbers for the corresponding third party sales order number in a listoutput.
Can anybody please provide inputs?
Regards.Hi Anjali,
Thanks for the response.
I have passed the PSGNUM and HLEVEL values while populating the data records. Then I sent the data records and control record information to the function module IDOC_INBOUND_WRITE_TO_DB. Inside this function module there is code to clear the PSGNUM values and HLEVEL values.
for compatibility: clear administration data of data records
perform data_records_wipe
tables
t_data_records.
FORM DATA_RECORDS_WIPE
TABLES
T_DATA_RECORDS_IN STRUCTURE EDIDD.
LOOP AT T_DATA_RECORDS_IN.
CLEAR: T_DATA_RECORDS_IN-MANDT,
T_DATA_RECORDS_IN-DOCNUM,
T_DATA_RECORDS_IN-SEGNUM,
T_DATA_RECORDS_IN-PSGNUM,
T_DATA_RECORDS_IN-HLEVEL.
modify t_data_records_in.
ENDLOOP.
ENDFORM. " DATA_RECORDS_WIPE
This is the code which is clearing all the PSGNUM and HLEVEL values. After coming out of this function module we are getting the error idocs created with disturbed hierarchy.
I need to create INBOUND Idocs with the data in ABAP program.
Please let me know if any inputs? Is there any function module existing to create Inbound Idocs inside an ABAP program?
Regards -
Function Module to get ABAP source code for a specific version
Hi all
Is there a function module that I can use to get the source code of another function module at a specific version?
For example, can I call a function module passing in "FM_NAME" and "FM_VERSION" and have it return the lines of code associated with that object?
Thanks in advance.
StuartThanks guys
That's incredibly helpful! I have one more question that I just thought of last night...
Is there a way to hook into the code activation process? I want to be able to take a snapshot of the ABAP source code at each point when it is activated for use in another system, but need to be able to intercept this event and get the source code at that point in time.
Any ideas?
Thanks! -
Hi,
We have a requirement to create a BI report based on plant maintenance report. The plant maintenance report is based on a ABAP program with complex logic. My question is i want create a Generic Datasource using Function module and can I include the logic(Abap Program) that is used for plant maintenance report in the function module? Please share your thoughts.
Thanks,
RaviHi,
Step1-Create a table structure which you need to create same as the fields you require in you data source.
Step 2-create a custom abap program and inside that call the Client abap program with the selections as required and save the result data in some table
Step 3-create infoset query.In the infoset query give your table structure name and program name which you developed.
Step4-create data source on top of that query -
Passing an XML file from WebDynpro app to ABAP function module
Hi all,
I'm stuck with a problem, and am hoping one of you could let me know how to proceed:
I need to pass an XML file (or at least the entire content of the XML) from my WebDynpro application to a backend ABAP function module. What I tried was this:
In my WebDynpro app, I read the XML and convert the content into one long string (using java.io.FileReader and java.io.BufferedReader). In my ABAP function module I created an import parameter of type String. I then imported the ABAP Function module into my WebDynpro app as a model. I then tried to pass the XML string to the ABAP module. What happens is this:
If the size of the string (XML) happens to be less than 255 characters, then it works. That is, the string is passed to the ABAP function module and I can see the contents. However, if the XML string happens to be greater than 255 characters, then it does not work. The string at the ABAP side is empty. Surprisingly, the ABAP module does not throw an error either. It just displays an empty string.
Could you please tell me what the problem is?
Thanks & Regards,
BijuHi Biju ,
Welcome to SDN.
If the import parameter is defined as type string it should work, however did you check whether your application pass it properly?
I have applications using strings as import parameters working fine. (webapplications (BSP) to RFC)
Regards
Raja -
Issue in creating web service for a ABAP Function Module
Hi,
now i'm learning how to create web service for a ABAP Function Module. I used the following steps.
1. select the Function Module, named "zws_test".
2. in the context menu, select "create->proxy object". so we enter into wizard.
3. in the wizard, press the radio button "Service Provider".
4. in the next page, press the radio button "Existing ABAP Objects(Inside Out)".
5. In the next page, Enter the "zws_test_prvider" as Service Definition and select "Function Module" as Endpoint Type.
6. in the next page, enter "zws_test" as Function Module and mark the "Mapping der Namen" button
7. in the next page,select "PRF_DT_IF_SEC_LOW" as Profile and mark "Deploy Service".
8. Save in the local package.
9. then it will pop up a window with title "WSDL Source". i selected "URL/HTTP Destination" and press "OK".
10.in the next page, i enter the URL as "http://hostname:portnumber/", and press "OK".
11. then it will pop up a window with title "Display logs". A record with error message "HTTP error(return code 404, message "Not found")" appears.
12. i press "ok" and a service provider with name "zws_test_prvider" appears in my local package.
13. i use "zws_test_prvider"'s URL to create a service consumer "ZCO_WS_TEST_CONSUMER" and logic portal "LP1".
14. But when i test my service consumer "ZCO_WS_TEST_CONSUMER", it will throw an exception "cx_ai_system_fault" with errortext "SOAP:14 Unexpected element -el=definitions ns=http://schemas.xmlsoap.org/wsdl/".
15. I use t-code SM59 to test connection and get the following info.
Status HTTP Response 200
Status Text OK
Duration Test Call 328 ms.
who can give me the reasons about item 11 and 14, and explain me how to create service provider and service consumer for a Function Module.
Thanks in advance
Johnneyhave you seen this weblog
/people/thomas.jung3/blog/2004/11/15/bsp-150-a-developer146s-journal-part-xiii-developing-abap-webservices -
Crystal Reports for VS2010 using a custom SAP ABAP function module data source
I recently worked with Crystal Reports 2011 and was able to connect and retrieve data from our R/3 system via an ABAP function module. While researching other features, I found this version that can be installed into Visual Studio 2010. The parameters are not very user friendly in Crystal Reports so I was hoping to create a custom dialog to collect my report parameters.
Does anyone know if I were to install Crystal Reports for Visual Studio 2010, would I be able to design a front-end selection screen in a Visual Basic form and then pass the input to through the Crystal Reports connection to my ABAP function module to retrieve the data filtered on the back-end by the selection screen parameters and return the results to be reported in the Crystal Reports output?
I am using Visual Studio 2010 Professional Visual Basic with the .NET Framework 4.0 on 32-bit Windows 7. I was able to connect to our R/3 system in Crystal Reports 2011, so if I were to install Crystal Reports for VS2010, would there be a similar way of connecting to SAP?
Any assistance or direction would be greatly appreciated.
Thanks,
BryanHello Bryan
I don't know for sure, but I doubt this will work in CRVS2010. Only hope is that the utility available for download in this KBA will point you in the right direction.
- Ludek
Follow us on Twitter
Got Enhancement ideas? Try the SAP Idea Place
Share Your Knowledge in SCN Topic Spaces
Maybe you are looking for
-
Error itms - 4099 : "Invalid ISBN"
I'm trying to upload my book with iTunes Producer, but get this error message. It's a good isbn, why won't it validate?
-
CreateMessage without a Service Operation
In previous versions of tools I could use CreateMessage(Message.MSG_NAME) to create a message. This now appears to have been removed in favour of CreateMessage(Operation.OP_NAME). This is fine when the required message is part of a service operation,
-
Bridge Mode - Could not join 'network '. A timeout error occurred
Have my airport express in bridge mode with a home hub 3 (that has its wireless network disabled). When i go to join the new wireless network i created on the airport express , it gives me the error in my title. What causes the timeout and how can it
-
What's new in the last firmware of 6630 (ver : 6.0...
Hi. I update my firmware today! But I don't see anything new in new firmware. Can you say what's fresh in this version ?
-
Server: s10u7 x86, Java 6 update 16 2 things, actually; The first is that when I try to add my server as a Desktop Provider, it says that the server is not accessible on port 443 (SSL). Apache2 is definitely running, and i get the 'Welcome' message w