Default values in tables for function module
Hi,
We've created a function module and it is their requirement to have a default value for the tables in the FM? How do we do this? Cause if it is just an import parameter there is a column for default values, but for tables there is none. How do we code this?
Thanks.
Hi,
In the start of the function module you can check the table and set your default values.
FUNCTION ...
"Check whether the table is initial
"Do not override the value passed by the user
IF itab[] IS INITIAL.
itab-field = 'DEFAULT'. "Set your default value
APPEND itab.
ENDIF.
- - - Your functionality
Regards
Wenceslaus.
Similar Messages
-
Table for Function modules - Changed date & Changed by.
Hi Experts,
Help me to get Function module changed date & changed by.
For programs we can get the mentained information in TABLE : TADIR.Function Modules change history can be retrieved from table TRDIR.
Function Module stores a program Include in table TRDIR.
The details of the Function Module can be found in Attributes-->general data tab in the Function Module.
You need to pass the Include which correponds the FM.
Hence you can find the Log changes.
Hope this helps.
Regards
Vinayak -
Hi Gurus,
I need the table for WHERE-USED-LIST of function modules.....
Answer will be rewarded full points...
Thx in advance.....Hope this code helps you.....
Function module where-used on programs:
SELECT * FROM cross APPENDING TABLE mycross
WHERE type = 'F'
AND name = <fm_name>.
Function module where-used on enhancements:
SELECT * "SINGLE enhname
FROM enhobj
INTO TABLE l_i_enhobj
WHERE obj_type ='FUNC'
AND obj_name EQ <fm_name>.
Function module where-used on Webdynpros:
SELECT * FROM cross APPENDING TABLE mycross
WHERE type = 'F'
AND name = <fm_name>.
AND ( include LIKE '/1BCWDY/S_____________________'
OR include LIKE '/1BCWDY/B_____________________' ).
l_inclname = mycross-include.
CALL FUNCTION 'WDY_WB_GET_CTRLNAME_BY_INCLUDE'
EXPORTING
p_inclname = l_inclname
IMPORTING
p_controller = l_controller
EXCEPTIONS
OTHERS = 1.
Function module where-used on Methods/Classes:
SELECT * FROM cross
APPENDING TABLE mycross
WHERE type = 'F'
AND name = <fm_name> AND
( include LIKE '______________________________C%' OR
include LIKE '______________________________I%' ).
To get the Class name (seokey-clsname), use the FM
CALL FUNCTION 'SEO_METHOD_GET_NAME_BY_INCLUDE'
EXPORTING
progname = mycross-include
IMPORTING
mtdkey = seokey. -
DB table for function module extractor
I would really appreciate any comment or suggestion about this topic: Function module based extraction. I opened this thread on the BC & Extractors forum, but unfortunately none has given me any feedback yet.
Thanks & Regards, DavideSo none see any advantage with storing the extracted data in a materialized DB table, before transmitting the records to BW. Can I infer it's probably not a good idea wasting time with an additional massive write operation?
Cheers, Davide -
Any docs regarding Table/View,Function Module for Generic Extraction
Hello All
I need to do Generic Extraction,for that if anyone has docs., I need docs on how to create table,view,Function module and infoset query ,on that pl forward to my id
[email protected]
Many Thanks
balajihi Amit
Thanks for your docs,but this docs i have already,do u have any thing different one,if so please forward?
Facing a Problem
Iam trying to create view(database view)for <b>vbak</b> and <b>vbap</b> and given in Tables in <b>Table/Join Conditions</b> tab and clicked in <b>Relationship</b> and the relantionship has been generated automatically,now when i tried to activate this view its saying like "<b>No tables and/or fields are defined for view xxxxx</b>(xxxx-> name of a view)
what will be the problem?pl let me know how to create a view?
And also I need to know the diffference between database view,Manintenance view,Projection view and help view?
Pl let me know on this?
Many Thanks
balaji -
ConfigurableVariant materialclassification values-Tables or Function module
Hi All,
We have a configurable material (say M01) with Class type 300 and have various characteristics assigned to the class. We have a variant material (say 234567) assigned to the configurable material M01. In the Characteristic values assignment screen we assign a value (say 123) to the characteristic Paper material.
Now my question is how to get the link between characteristic Paper material (123) and variant material (234567). We have a transaction CL31 where you can get variant material if you give the paper material characteristic. I want to know if there is any table or Function module available to get the link.
Appreciate your reply.
Thanks,
Srinivasthis type of setting is in the item category settings from sales order.
if your selction criteria (values ) matches with the exiting material code which got same charectristic valeus as that of selection in Sales order, that material will be replace by exiting material code.
you can see that setting in spro>Sales and Distribution>Sales>Sales Documents>Sales Document Item-->Define Item Categories here indicator variant maching should be ticked and Mat. Variant Action as 2 or 4.
Regards,
Pravin Mukkawar -
How to log input parameters for Function Modules?
Hi,
I need to create a Logging system to trace input parameters for function modules.
The log functionality could be done by developing a class method or a function module (For example 'write_log'), and calling it within each function module that I want to log. The 'write_log' code should be independent from the interface of the Function Module that I want to log.
For example, I'd like to write a function/class method that can log both these functions modules:
Function DummyA
Input parameters: A1 type char10, A2 type char10.
Function DummyB
Input parameters: B1 type char20, B2 type char20, B3 type char20, B4 type Z_MYSTRUCTURE
Now the questions...
- Is there a "standard SAP" function that provide this functionality?
- If not, is there a system variable in which I can access runtime all parameters name, type and value for a particular function module?
- If not, how can I loop at Input parameters in a way that is independent from the function module interface?
Thank you in advance for helping!check this sample code. here i am capturing only parameters (import) values. you can extend this to capture tables, changin, etc.
FUNCTION y_test_fm.
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(PARAM1) TYPE CHAR10
*" REFERENCE(PARAM2) TYPE CHAR10
*" REFERENCE(PARAM3) TYPE CHAR10
DATA: ep TYPE STANDARD TABLE OF rsexp ,
ip TYPE STANDARD TABLE OF rsimp ,
tp TYPE STANDARD TABLE OF rstbl ,
el TYPE STANDARD TABLE OF rsexc ,
vals TYPE tihttpnvp ,
wa_vals TYPE ihttpnvp ,
wa_ip TYPE rsimp .
FIELD-SYMBOLS: <temp> TYPE ANY .
CALL FUNCTION 'FUNCTION_IMPORT_INTERFACE'
EXPORTING
funcname = 'Y_TEST_FM'
* INACTIVE_VERSION = ' '
* WITH_ENHANCEMENTS = 'X'
* IGNORE_SWITCHES = ' '
* IMPORTING
* GLOBAL_FLAG =
* REMOTE_CALL =
* UPDATE_TASK =
* EXCEPTION_CLASSES =
TABLES
exception_list = el
export_parameter = ep
import_parameter = ip
* CHANGING_PARAMETER =
tables_parameter = tp
* P_DOCU =
* ENHA_EXP_PARAMETER =
* ENHA_IMP_PARAMETER =
* ENHA_CHA_PARAMETER =
* ENHA_TBL_PARAMETER =
* ENHA_DOCU =
EXCEPTIONS
error_message = 1
function_not_found = 2
invalid_name = 3
OTHERS = 4
IF sy-subrc = 0.
LOOP AT ip INTO wa_ip .
MOVE: wa_ip-parameter TO wa_vals-name .
ASSIGN (wa_vals-name) TO <temp> .
IF <temp> IS ASSIGNED .
wa_vals-value = <temp> .
ENDIF .
APPEND wa_vals TO vals .
ENDLOOP .
ENDIF.
ENDFUNCTION. -
Populate final table in Function module
hi,
please tell me the way to populate the final intenal table in function module, form four of the other tables with the corresponding data. i'd like to know how to move fileds of one table to other with maximum performance, can i user move-corresponding for the same.........hi,
There are two ways to move the data ....
1. You can loop through the table data and move the corresponding field on to your final internal table .
2. You can directly assign the table value ...but remember the stucture of both the tables should be same.
i.e,
itab1[] = itab[].
Regards,
Santosh -
Exporting Custom table through function module
<b>How can i Export Custom table through function module.</b> when we add some table in the function module table tab it asks for a ref. table which is some table in database .. but i want to add some custom table with some user defined column names..how can i do this
<b>n plz tell me how to loop thru select options</b>
i have to loop thru select option and assign all the values to a variable.
plz help me out
Message was edited by:
Karan ChopraHi Karan,
Do one thing, Just in the tables tab give the name of the table and don't write anything else. no TYPE and no ANY.
Hope it will resolve issue.
reward points if useful.
Regards,
Atish -
Creating Includes for Function Modules
Hi Experts,
Can you please let me know how to create includes for function modules.
I came across this in a standard include program, which was generated by a function library. The includes inside this program where linked to the function modules (when I double clicked on them).
Please let me know how to create it.
Thanks in advance !
Regards,
Anand Patil.Hi,
have a look at the code for better understanding
Declaration of Workareas *
DATA: lwa_e1bp2017_gm_item_create TYPE e1bp2017_gm_item_create,
lwa_data TYPE edidd, " Work area for IDOC
lwa_control TYPE edidc. " Work Area for control rec
Read the control data information of idoc.
loop at idoc_contrl INTO lwa_control Where mestyp = lc_mbgmcr.
Extract the data from the segments.
LOOP AT idoc_data INTO lwa_data
WHERE docnum = lwa_control-docnum and
segnam = lc_item_create.
*->> Set the tabix of the internal table
lv_index = sy-tabix.
Move the Material Document Item Segment data
MOVE lwa_data-sdata TO lwa_e1bp2017_gm_item_create.
Modify the material document item data internal table
PERFORM sub_modify_idocdata changing lwa_e1bp2017_gm_item_create.
*->> set the changed values to the IDOC SDATA
MOVE lwa_e1bp2017_gm_item_create TO lwa_data-sdata.
*->> Modify the table
MODIFY idoc_data FROM lwa_data index lv_index.
Clear the Work areas
CLEAR : lwa_data,
lwa_e1bp2017_gm_item_create.
ENDLOOP. "LOOP AT t_idoc_data
Call the BAPI function module to create the
appropriate Material Document
CALL FUNCTION 'BAPI_IDOC_INPUT1'
EXPORTING
input_method = input_method
mass_processing = mass_processing
IMPORTING
workflow_result = workflow_result
application_variable = application_variable
in_update_task = in_update_task
call_transaction_done = call_transaction_done
TABLES
idoc_contrl = idoc_contrl
idoc_data = idoc_data
idoc_status = idoc_status
return_variables = return_variables
serialization_info = serialization_info
EXCEPTIONS
wrong_function_called = 1
OTHERS = 2.
IF sy-subrc = 1.
RAISE wrong_function_called.
ENDIF.
endloop.
ENDFUNCTION.
here when we write the statment
PERFORM sub_modify_idocdata changing lwa_e1bp2017_gm_item_create and double click on sub_modify_idocdata .
it will create a include with the name "LZDTSINT052F_GPOMS_GMF01 ".
now we can write the FORM ..END FORM In this inculde.like this.
***INCLUDE LZDTSINT052F_GPOMS_GMF01 .
*& Form sub_modify_idocdata
Modify the material document item data internal table
FORM sub_modify_idocdata
CHANGING pwa_e1bp2017_gm_item_create TYPE e1bp2017_gm_item_create.
contant declaration
CONSTANTS: lc_261(3) TYPE c VALUE '261'.
DATA : lv_aplzl LIKE resb-aplzl,
lv_aufpl LIKE resb-aufpl,
lv_subrc LIKE sy-subrc,
lv_charg LIKE resb-charg,
lv_uom LIKE pwa_e1bp2017_gm_item_create-entry_uom.
CLEAR: pwa_e1bp2017_gm_item_create-reserv_no,
pwa_e1bp2017_gm_item_create-res_item.
*->> Get SAP storage bin & Storage type from the Z table
SELECT lgtyp lgpla
INTO (pwa_e1bp2017_gm_item_create-stge_type,
pwa_e1bp2017_gm_item_create-stge_bin)
UP TO 1 ROWS
FROM zdtsint050_sttyp
WHERE zstorage_typ = pwa_e1bp2017_gm_item_create-stge_type
AND zstorage_bin = pwa_e1bp2017_gm_item_create-stge_bin.
ENDSELECT.
IF sy-subrc NE 0.
CLEAR: pwa_e1bp2017_gm_item_create-stge_type,
pwa_e1bp2017_gm_item_create-stge_bin.
ENDIF.
PERFORM get_oper CHANGING pwa_e1bp2017_gm_item_create.
Get the Reservation number and Reservation item number
basing on the idoc data.
SELECT rspos werks lgort
INTO (pwa_e1bp2017_gm_item_create-res_item,
pwa_e1bp2017_gm_item_create-plant,
pwa_e1bp2017_gm_item_create-stge_loc)
FROM resb
UP TO 1 ROWS
WHERE rsnum = pwa_e1bp2017_gm_item_create-reserv_no
AND matnr = pwa_e1bp2017_gm_item_create-material
AND charg = pwa_e1bp2017_gm_item_create-batch
AND aufnr = pwa_e1bp2017_gm_item_create-orderid
AND vornr = pwa_e1bp2017_gm_item_create-activity
AND bwart = lc_261.
ENDSELECT.
IF sy-subrc <> 0.
Start of insertion for R31K993797
CLEAR lv_charg.
SELECT rspos werks lgort
INTO (pwa_e1bp2017_gm_item_create-res_item,
pwa_e1bp2017_gm_item_create-plant,
pwa_e1bp2017_gm_item_create-stge_loc)
FROM resb
UP TO 1 ROWS
WHERE rsnum = pwa_e1bp2017_gm_item_create-reserv_no
AND matnr = pwa_e1bp2017_gm_item_create-material
AND charg = lv_charg
AND aufnr = pwa_e1bp2017_gm_item_create-orderid
AND vornr = pwa_e1bp2017_gm_item_create-activity
AND ( splkz = 'X' or
splkz = space )
AND bwart = lc_261.
ENDSELECT.
IF sy-subrc <> 0.
End of insertion for R31K993797
SELECT SINGLE werks lgort
INTO (pwa_e1bp2017_gm_item_create-plant,
pwa_e1bp2017_gm_item_create-stge_loc)
FROM resb
WHERE rsnum = pwa_e1bp2017_gm_item_create-reserv_no.
CLEAR : pwa_e1bp2017_gm_item_create-reserv_no,
pwa_e1bp2017_gm_item_create-res_item.
ENDIF.
ENDIF.
get SAP UOM
SELECT SINGLE zsap_uom
INTO lv_uom
FROM zca_uom_conv
WHERE zext_uom = pwa_e1bp2017_gm_item_create-entry_uom.
IF sy-subrc = 0.
pwa_e1bp2017_gm_item_create-entry_uom = lv_uom.
ENDIF.
ENDFORM. " sub_modify_idocdata
*& Form get_oper
Get the operation
<--P_PWA_E1BP2017_GM_ITEM_CREATE_RE Segment
FORM get_oper CHANGING p_pwa_e1bp2017_gm_item_create TYPE
e1bp2017_gm_item_create.
DATA : l_aufpl LIKE afko-aufpl,
l_aplzl LIKE afvc-aplzl.
REFRESH : i_op.
UNPACK p_pwa_e1bp2017_gm_item_create-orderid TO
p_pwa_e1bp2017_gm_item_create-orderid.
Get the reservation and routing number for the order
SELECT SINGLE
rsnum
aufpl
FROM afko
INTO (p_pwa_e1bp2017_gm_item_create-reserv_no,
l_aufpl)
WHERE aufnr = p_pwa_e1bp2017_gm_item_create-orderid.
IF sy-subrc = 0.
CALL FUNCTION 'CONVERSION_EXIT_NUMCV_INPUT'
EXPORTING
input = p_pwa_e1bp2017_gm_item_create-activity
IMPORTING
output = p_pwa_e1bp2017_gm_item_create-activity.
ENDIF.
ENDFORM. " get_oper
Regards,
nagaraj -
What are the input parameters for Function Module
Dear Experts,
I want to generate a Sales Tax returns report,those fields are not available in my existing Datasources.
For that i want to write a Generic Datasource with Function Module.
audat
bukrs
vkorg
vtweg
spart
aurat
auart
netwr
mwsbp
kschl zedp(consition type)
kschl zvat(condition type)
ksch zcst(condition type)
matkl material group
Here what are the Input parameters for Function Module.
Thanks in Advance.
Srinivasan.Srinivasan-
For creating a Generic extractor based on a FM, you first of all need to know what is going to be your structure.. i.e. what all fields you need to pull from what all tables. A functional consultant may help you identify the exact DB tables.
Once you know them, hand over the requirement and the pdf mentioned by Krishna to the ABAP guy, he would be able to take this up further.
Also decide 1st whether you would be using a full load or delta. There is a slight difference in the way they are built.
Let me know how it goes.
-Bhushan. -
Vendor-Customer balances in group currency-table/structure/function module?
Hi All,
Which table/structure/function module can be used to get balances for vendors and customers in group currency? We just wnat to extract balances in group currency so FBL1N and FBL5N are not options. Is there any SAP report which can provide these balances for both vendors and customers?
Thanks and regards,
PinkyHi Pinky,
I came across one report S_ALR_87012079 - Transaction Figures: Account Balance, Program RFSRRCUA, which extracts Account Balances of Vendor. Once the report is executed, you can do Currency Translation from one currency to different currencies. In the output screen, in the Top Menu, select 'Settings -> Currency' and you can convert to another currency. I am not sure, if this helps you. If this helps, kindly update your comments here.
Thank you.
Suresh Jayanthi. -
CAPP - standard value calculation origin 9 function module CE22.
Dear,
I've a project where i need to calculate standard value time based on multiple and various criteria. (standard price of a all components assigned to one operation)
I've seen that it should be possible to calculate a characterisitic value based on a function module in a method. (characterisitic value origin 9 - function module).
When i try to use the method with a function module I get a dump. ( CALL_FUNCTION_PARM_MISSING).
I don't find any documentation on the usage of a function module. as origin for CAPP.
Could you please help me ?
Br,
Daniel.There are so many threads and documentation available on the same..Please search the same.
Moreover if you share the error then it would be easy to know the exact problem
Regards,
AL -
Hi Gurus,
I have to connect two table through function module in ECC side.
Both table contains some field.
I am not much familiar with ABAP.
So PLease give some demo coding for this.
Coding to connect two tables by function module.
Thanks.
Saurabh JainHi,
Please find the sample code.Here I am extracting data from three tables.
SELECT
a~vbeln
a~MATNR
a~CHARG
a~POSNR
a~SPART
a~ERDAT
a~AEDAT
a~KWMENG
a~PSTYV
c~KUNNR
c~VKGRP
c~VKBUR
c~VTWEG
c~VKORG
c~BUKRS
c~VKGRP
FROM((VBAP AS a INNER JOIN VBPA AS b
ON avbeln = bvbeln
AND aposnr = bposnr)INNER JOIN VBAK AS c ON cvbeln = bvbeln
AND cposnr = bposnr).
Modify in the way you want and Just include these codes into the Funtion module you create.
I Hope it my help you.
Regards,
Prem -
Looking for function module to update User data
Hi All,
I'm looking for function module/base table to update data into User (User-Specific Data) data. You can notice it under PRTE t.code. Thank you.
Regards
KishoreTo Read: HRTRV_IF_GET_TRIP
To Modify: HRTRV_IF_MODIFY_TRIP
Please be aware that these FMs are not released for customers, i.e. you won't get any support for them.
EDIT: Since you are dealing with Structure USER/PTK99, maybe the document I created is of interest to you: Adding fields in Travel WDA Applications
Cheers, Lukas
Message was edited by: Lukas Weigelt
Maybe you are looking for
-
hi i am using iphone 3gs 32gb. i installed itunes in my laptop but i couldnot found all files like music and videos present in my laptop. can anybody tel how to get all content? thanks you
-
I am trying to install Windows 7 using Bootcamp Assistence 5.0 on a MacBook Pro Retina OSX 10.8.2, I went through all steps on Creatting the Windows 7.iso into a bootable USB Dirve 16GB I use a separate USB Drive 2 GB and download Windows Support Dri
-
System Fan(90B) error...
I bought an HP 630 Notebook PC one month ago. Now, when it's powerd on, it's showing an error message like "System Fan is not working correctly System Fan(90B)". Though my laptop is currently working but I suspect, soon it will be in trouble due to
-
I have never scripted for Acrobat, though I have done a lot of JS scripting for Photoshop. I have written a script that will do a page by page merge of two pdfs (ie one being the front side scan of a document and one the reverse side scan). It works
-
I have an app that pulls in xml data and places it appropriately into textfields. Some data looks like this: <![CDATA[<p>Click on the links below for more information about the types of crash sensors.<br/><li><a href='event:Safing Sensor'><font color