Require a Function Module
Hi,
Please give me the function module name which converts the date from internal format (YYYYMMDD) TO (MMDDYYYY).
Regards
Reddy
So if you user settings are set as MM/DD/YYYY, then you can do this.
REPORT ZRICH_0001.
data: datum type sy-datum.
data: datum_out(10) type c.
datum = sy-datum.
call function 'CONVERT_DATE_TO_EXTERNAL'
EXPORTING
DATE_INTERNAL = DATUM
IMPORTING
DATE_EXTERNAL = datum_out.
write:/ datum_out.
If you don't want the '/' in the datum_out, you can do this.
REPORT ZRICH_0001.
data: datum type sy-datum.
data: datum_out(10) type c.
datum = sy-datum.
call function 'CONVERT_DATE_TO_EXTERNAL'
EXPORTING
DATE_INTERNAL = DATUM
IMPORTING
DATE_EXTERNAL = datum_out.
<b>translate datum_out using '/ '.
condense datum_out no-gaps.</b>
write:/ datum_out.
If you want to force the formatting regardless of user setting, you can do this.
REPORT ZRICH_0001.
data: datum type sy-datum.
data: datum_out(10) type c.
datum = sy-datum.
concatenate sy-datum+4(2) sy-datum+6(2) sy-datum+0(4)
into datum_out SEPARATED BY '/'.
write:/ datum_out.
If you don't want the '/', then simply remove the SEPARATED BY '/'.
REPORT ZRICH_0001.
data: datum type sy-datum.
data: datum_out(10) type c.
datum = sy-datum.
concatenate sy-datum+4(2) sy-datum+6(2) sy-datum+0(4)
into datum_out.
write:/ datum_out.
Regards,
Rich Heilman
Similar Messages
-
Generic Extraction business Requirement, through function module,
Generic Extraction business Requirement, specifically through function module and source code in function module.
Dear Karthik,
Go to transaction SBIW -> Generic Datasource -> Maintain Generic Datasources -> Choose Master/Transaction Data -> Maintain proper entries (Application Component, Descriptions) -> Extraction by FM if you want to extract using FM.
Maintaining Generic DataSources - Independently of application, you can create and maintain generic DataSources for transaction data, master data attributes or texts from any kinds of transparent tables, database views, InfoSets of the SAP query or using a function module. As a result, you can make use of the generic extraction of data.
Creating a Generic DataSource
1. Select the DataSource type and give it a technical name.
2. Choose Create. The creating a generic DataSource screen appears.
3. Choose an application component to which the DataSource is to be assigned.
4. Enter the descriptive texts. You can choose any text.
5. Choose from which datasets the generic DataSource is to be filled.
a. Choose Extraction from View, if you want to extract data from a transparent table or a database view. Enter the name of the table or the database view.
After generation, you get a DataSource whose extract structure is congruent with the database view or the transparent table view.
For more information about creating and maintaining database views and tables, see the ABAP Dictionary Documentation.
b. Choose Extraction from Query, if you want to use a SAP query InfoSet as the data source. Select the required InfoSet from the InfoSet catalog.
After generation, you now have a DataSource whose extract structure matches the InfoSet.
For more information about maintaining the InfoSet, see the System Administration documentation.
c. Choose Extraction using FM, if you want to extract data using a function module. Enter the function module and extract structure.
The data must be transferred by the function module in an interface table E_T_DATA.
For information about the function library, see the ABAP Workbench: Tools documentation.
d. With texts, you also have the option of extraction from domain fixed values.
Maintain the settings for delta transfer where appropriate.
7. Choose Save.
Note when extracting from a transparent table or view:
If the extract structure contains a key figure field, that references to a unit of measure or currency unit field, this unit field must appear in the same extract structure as the key figure field.
A screen appears in which you can edit the fields of the extract structure.
8. Editing the DataSource:
Selection
When scheduling a data request in the BW Scheduler, you can enter the selection criteria for the data transfer. For example, you may want to determine that data requests are only to apply to data from the previous month.
If you set the Selection indicator for a field within the extract structure, the data for this field is transferred in correspondence with the selection criteria in the scheduler.
Hide field
You should set this indicator to exclude an extract structure field from the data transfer. As a result of your action, the field is no longer made available in BW when setting the transfer rules and generating the transfer structure.
Inversion
Reverse postings are possible for customer-defined key figures. For this reason, inversion is only possible for certain transaction data DataSources. These include DataSources that have a field that is indicated as an inversion field, for example, the field update mode in the DataSource 0FI_AP_3. If this field has a value, then the data records are interpreted as reverse records in BW.
Set the Inversion indicator if you want to carry out a reverse posting for a customer-defined field (key figure). The value of the key figure is then transferred in inverted form (multiplied by 1) into BW.
Field only known in exit
You can enhance data by extending the extract structure for a DataSource using fields in append structures.
The indicator Field only known in Exit is set for fields of an append structure. In other words, by default these fields are not passed onto the extractor from the field list and selection table.
Deselect the indicator Field Only Known in Exit to enable the Service API to pass on the append structure field to the extractor together with the fields of the delivered extract structures in the field list as well as in the selection table.
9. Choose DataSource -> Generate.
The DataSource is now saved in the source system.
Maintaining Generic DataSources
· Change the DataSource
To change a generic DataSource, in the initial screen of DataSource maintenance, enter the name of the DataSource and choose Change.
You can change the assignment of a DataSource to an application component as well as the texts of a DataSource. Double-clicking on the name of the table, view, InfoSet or extract structure takes you to the appropriate maintenance screen. Here you can make changes required to add new fields. You can fully swap transparent tables and database views, but not InfoSets. If you return to the DataSource maintenance and choose Create, the screen for editing a DataSource appears. To save the DataSource in the SAP source system, choose DataSource -> Generate.
If you want to test extraction in the source system independently of a BW system, choose DataSource -> Test Extraction.
· Delta DataSource
In the Change Generic DataSource screen, you can delete any DataSources that are no longer relevant. If you are extracting data from an InfoSet, delete the associated query. If you want to delete a DataSource, this must not be connected to a BW system.
Also visit :[Data Extraction from SAP Source System | http://help.sap.com/saphelp_nw04/helpdata/en/28/4c553c42360a40e10000000a114084/content.htm]
Regards,
Naveen. -
Spool number required in Functional Module for BTE
Hello all,
As per client requirement to store dunning data into one Z table and send the same to third part.
For this we are planning to using BTE.
To update the data in Z table we need spool number. But that spool number is not available in sample functional module.
Spool number is available in structure ITCPP but in our functional module available structure is ITCPO.
Please suggest available alternative solutions to proceed further.
Thanks in advance.
Amar.Hello experts,
Could you please let me know which Business transaction events we can use for Remittence advice and Customer statement.
My requiremnt is to update data in Z table including spool data.
Quick response is highly appreciable with points.
Thanks & regards,
Amar. -
Require a function module to add days to a date?
My purpose is to add days to a particular date and get the resulting date. I tried using this function module "RP_CALC_DATE_IN_INTERVAL", but the problem is this function module only accepts two digits for days. i.e. i am only able to add a maximum of 99 days to a particular date, but i do want to go further and add more so please tell me if there is any function module which shall help me add 3 digit days to a date.
Hi Kiran,
You can directly add days to the date.
Eg:
DATA date LIKE sy-datum.
DATA days TYPE i.
date = sy-datum.
days = 100.
date = date + days.
WRITE date.
Regards
Wenceslaus -
Require a function module to calculate sum of the quantity based on GRNDATE
hi friends,
I need to calculate the sum of the quantity based on GRN DATE and invoice date.
the invoice date given in select-options should be captured by program and from the previous day it need to retrieve the GRN dates and corresponding quantities and i need to do the summation of all these quantities can anybody tell any function module.
Thanks in advance.Try function MD_CONVERT_MATERIAL_UNIT
the table of UOM's is MARM.
Doug -
Documentation Required for Function Module
Hi,
Can Provide me the documentation how to create function module in ABAP.
Regards
Ravihi,
BAPI Step by step Guidance
BAPI stands for Business Application Programming Interface.
There are 5 different steps in BAPI.
- Create BAPI Structure
- Create BAPI Function Module or API Method.
- Create BAPI object
- Release BAPI Function Module.
- Release BAPI object.
Step1. Creating BAPI Structure:
- Go to <SE11>.
- Select Data Type & Enter a name.
- Click on Create.
- Note: Always BAPI should be in a development class with request number (Not Local Object).
- Select Structure & hit ENTER.
- Enter the fields from your database. Make sure that the first field is the Primary Key Field.
- Then SAVE & ACTIVATE.
Step 2. Creating BAPI module:
- Enter TR.CODE <SE37>.
- Before entering any thing, from the present screen that you are in, select the menu
Goto -> Function Groups -> Create Group.
Enter a name (ZBAPI)
Let this screen be as it is and open another window and there, enter TR.CODE <SE80).
Click on the Third ICON that says Inactive Objects.
Select the group that you just created and click on Activate.
Notice that the group you created will disappear from the list of inactive objects.
- Go back to <SE37> screen and enter a name and hit <ENTER>. Then enter the group name that you just created and activated.
NOTE: When you release a function module the respective group will be attached to that particular application. It cannot be used for any other application. NEVER include an already existing group that is attached to another module.
Now click on the first Tab that says [ATTRIBUTES] and select the radio button that says remote-enabled module since we will be accessing this from any external system.
Then click on the second tab that says [IMPORT].
Enter a PARAMETER NAME, TYPE and the structure you created in the first step. Also select the check box u2018Pau2019. All remotely enabled functional modules MUST be Pa enabled, where Pa means u2018Passed by Valueu2019 and if you donu2019t select u2018Pau2019, then that means it will be passed by reference..
Then click on tab that says [EXPORT].
Enter the following as is in the first three fields
RETURN TYPE BAPIRETURN (These 3 field values are always same)
Here also select u2018Pau2019 meaning Pass by value.
Note: BAPIRETURN contains structure with message fields.
Then SAVE and ACTIVATE.
Ram .
Edited by: Ramakullay Challa on Jun 2, 2009 10:31 AM -
Require a Function Module or a BAPI
Hi,
Does anyone in here knows a FM or a BAPI(preferred) that would take the Material Number & Plant as input and return the available quantity available under different storage location for the plant.
No logic is to be written. Strict usage of FM or BAPI.
Suggestions welcomed.
Thanks & Regards,
RajeshBAPI_MATERIAL_GET_DETAIL can be used.
If you change your mind sometime,
here is the code for it
select matnr
werks
lgort
LABST
from mard
into table it_mard
where matnr in s_matnr
and werks in s_werks.
Regards,
ravi -
Require function module for transaction MI09
hi,
i require a Function Module that would perform the operation of transaction MI09 i.e to post count of physical inventory without reference to inventory document number
please helpHi,
The easiest way to find the FM in MI09 is,
go to transaction MI09.
system--> status and goto the Program name.
Double click the program name and Search what are the FM are used.
Search using ' Call Function ' String , to find out the
Fms are used in MI09.
Thanks,
Neptune.M
Plz Reward if it helps. -
Calling a report from function module
Hi Friends,
I have requirement for Function Module i.e. we will add the button to the standard T-code and ( Function added in config ) then
Function to be called from Customizing
Program A called from customizing function
CalculationPDFFunction is called from program A.
So can any one help me the logic for "calling a report from function module ".
Thanks in Advance.
Regards,
OSReddy.
Edited by: OSReddy on Sep 23, 2011 7:31 AMHi Jaya,
Yes. It is possible to call ur custom program using SUBMIT statement.
1. If u have data to pass then build table type RSPARAMS and use below statement.
data:
rspar_tab TYPE TABLE OF rsparams,
rspar_line LIKE LINE OF rspar_tab,
SUBMIT report1 WITH SELECTION-TABLE rspar_tab
AND RETURN.
1. If u want to create variant to the program and use that. use the below statement .
SUBMIT report1 USING SELECTION-SET 'VAR1' "variant
AND RETURN.
Regards,
Venkat.O -
Function Module to identify released transports
Hi,
We required one function module or table where we can find the released transports in target system.
Suppose if we release one transport in developement, before importing to target system i want to identify the released trasport details in test system.
Thanks in advance
RajuFirst Thanks for your replies
Actually we required one way (function moudle or table) to find the released trasnports in target system.
As i explained earlier, suppose if i releae one request in development system, we want to find the that released transport test system, before importing to test system.
Thnaks,
Raju -
Function module (Z_USR_INSTANT_CREATION1)
Hi Experts,
Please look into below coding and solve my problem.
FUNCTION Z_USR_INSTANT_CREATION1.
""Local Interface:
*" IMPORTING
*" VALUE(USERNAME1) LIKE BAPIBNAME-BAPIBNAME
*" VALUE(ACCTNO) TYPE /BIC/OIZCUSTOMER
*" VALUE(LOGONDATA1) LIKE BAPILOGOND STRUCTURE BAPILOGOND
*" VALUE(PASSWORD1) LIKE BAPIPWD STRUCTURE BAPIPWD DEFAULT
*" 'initpass'
*" VALUE(FIRSTNAME) TYPE /BI0/OINAME
*" VALUE(LASTNAME) TYPE /BI0/OINAME3
*" VALUE(ADDRESS1) LIKE BAPIADDR3 STRUCTURE BAPIADDR3 OPTIONAL
*" VALUE(REF_USER1) LIKE BAPIREFUS STRUCTURE BAPIREFUS OPTIONAL
*" VALUE(IP_V) TYPE RSINFOPROV DEFAULT 'ZEX_DS01'
*" VALUE(IP_H) TYPE RSINFOPROV DEFAULT 'ZEX_DS02'
*" EXPORTING
*" VALUE(CREATERRCODE) TYPE RSRCHANGEFLAG
*" VALUE(ROLERRCODE) TYPE RSRCHANGEFLAG
*" TABLES
*" RETURN1 STRUCTURE BAPIRET2
*" PROFILES1 STRUCTURE BAPIPROF
*" RETURN2 STRUCTURE BAPIRET2
*" RETURN3 STRUCTURE BAPIRET2
*" RETURN4 STRUCTURE BAPIRET2
DATA: NEWS(40), pwd(8).
data : ZACTGRP like BAPIAGR occurs 0 with header line.
Check if the user already exists.
CALL FUNCTION 'BAPI_USER_EXISTENCE_CHECK'
EXPORTING
username = USERNAME1
IMPORTING
return = RETURN1.
WRITE: RETURN1-type, RETURN1-MESSAGE.
IF sy-subrc EQ 0.
Call Function module to create UserId
*ADDRESS1-FIRSTNAME = 'Sreeni'.
*ADDRESS1-LASTNAME = 'Varadha'.
ADDRESS1-FIRSTNAME = FIRSTNAME.
ADDRESS1-LASTNAME = LASTNAME.
WRITE: /1 '*** FIRST AND LASTNAME PASSED BY JAVA: ', ADDRESS1-FIRSTNAME, ADDRESS1-LASTNAME.
CALL FUNCTION 'BAPI_USER_CREATE1'
EXPORTING
USERNAME = USERNAME1
LOGONDATA = LOGONDATA1
PASSWORD = PASSWORD1
ADDRESS = ADDRESS1
REF_USER = REF_USER1
TABLES
RETURN = RETURN2.
*CREATE FAILURE ERROR TYPE IS SENT BACK TO PORTAL
CREATERRCODE = RETURN2-TYPE.
Call Function module to Deactivate Password
CALL FUNCTION 'BAPI_USER_CHANGE'
EXPORTING
USERNAME = USERNAME1
LOGONDATA = LOGONDATA1
ADDRESS = ADDRESS1
REF_USER = REF_USER1
TABLES
RETURN = RETURN3.
WRITE: RETURN2-MESSAGE, CREATERRCODE.
WRITE: RETURN3-MESSAGE.
ELSE.
User already Exists need to direct send back the return code to java.
WRITE: RETURN1-MESSAGE.
CREATERRCODE = RETURN2-TYPE.
ENDIF.
clear: zactgrp.
refresh zactgrp.
zactgrp-agr_name = 'ZPMUSA_STORE_USER'.
Zactgrp-from_dat = sy-datum.
zactgrp-to_dat = '99991231'.
append zactgrp.
Call function module to assign role to the User Id
CALL FUNCTION 'BAPI_USER_ACTGROUPS_ASSIGN'
EXPORTING
USERNAME = USERNAME1
TABLES
ACTIVITYGROUPS = zactgrp
RETURN = RETURN4.
*ROLE ASSIGN FAILURE ERROR TYPE IS SENT BACK TO PORTAL
ROLERRCODE = RETURN4-TYPE.
WRITE: ROLERRCODE.
Code to Insert records into ZSTAODS
DATA: ZSTAODS_ITAB LIKE /BIC/AZSTAODS00 OCCURS 0 WITH HEADER LINE.
ZSTAODS_ITAB-TCTUSERNM = USERNAME1.
ZSTAODS_ITAB-TCTADTO = '99991231'.
ZSTAODS_ITAB-TCTIOBJNM = 'ZCUSTOMER'.
ZSTAODS_ITAB-TCTSIGN = 'I'.
ZSTAODS_ITAB-TCTOPTION = 'EQ'.
ZSTAODS_ITAB-TCTLOW = ACCTNO.
ZSTAODS_ITAB-TCTHIGH = ACCTNO.
ZSTAODS_ITAB-TCTOBJVERS = 'A'.
ZSTAODS_ITAB-TCTADFROM = SY-DATUM.
APPEND ZSTAODS_ITAB.
MODIFY /BIC/AZSTAODS00 FROM TABLE ZSTAODS_ITAB.
clear: ZSTAODS_ITAB.
Code to Delete records from ZEX_DS01 & ZEX_DS02*
DELETE FROM /BIC/AZEX_DS0100.
DELETE FROM /BIC/AZEX_DS0200.
Code to Insert records into ZEX_DS01*
DATA: ZEX_DS01_ITAB LIKE /BIC/AZEX_DS0100 OCCURS 0 WITH HEADER LINE.
ZEX_DS01_ITAB-TCTUSERNM = USERNAME1.
ZEX_DS01_ITAB-TCTADTO = '99991231'.
ZEX_DS01_ITAB-TCTIOBJNM = 'ZCUSTOMER'.
ZEX_DS01_ITAB-TCTSIGN = 'I'.
ZEX_DS01_ITAB-TCTOPTION = 'EQ'.
ZEX_DS01_ITAB-TCTLOW = ACCTNO.
ZEX_DS01_ITAB-TCTHIGH = ACCTNO.
ZEX_DS01_ITAB-TCTOBJVERS = 'A'.
ZEX_DS01_ITAB-TCTADFROM = SY-DATUM.
APPEND ZEX_DS01_ITAB.
MODIFY /BIC/AZEX_DS0100 FROM TABLE ZEX_DS01_ITAB.
clear: ZEX_DS01_ITAB.
Code to Insert records into ZEX_DS02*
DATA: ZEX_DS02_ITAB LIKE /BIC/AZEX_DS0200 OCCURS 0 WITH HEADER LINE.
ZEX_DS02_ITAB-TCTUSERNM = USERNAME1.
ZEX_DS02_ITAB-TCTADTO = '99991231'.
ZEX_DS02_ITAB-TCTIOBJNM = 'ZCUSTOMER'.
ZEX_DS02_ITAB-TCTHIENM = 'RETAIL HIERARCHY'.
ZEX_DS02_ITAB-TCTHIEVERS = 'A'.
ZEX_DS02_ITAB-TCTHIEDATE = '99991231'.
ZEX_DS02_ITAB-TCTNIOBJNM = 'ZCUSTOMER'.
ZEX_DS02_ITAB-TCTATYPE = '1'.
ZEX_DS02_ITAB-TCTACOMPM = '1'.
ZEX_DS02_ITAB-TCTTLEVEL = '99'.
ZEX_DS02_ITAB-TCTNODE = ACCTNO.
ZEX_DS02_ITAB-TCTOBJVERS = 'A'.
ZEX_DS02_ITAB-TCTADFROM = SY-DATUM.
APPEND ZEX_DS02_ITAB.
MODIFY /BIC/AZEX_DS0200 FROM TABLE ZEX_DS02_ITAB.
clear: ZEX_DS02_ITAB.
Code of RSSM_GENERATE_AUTHORIZATIONS to generate profile from ZEX_DS01 & ZEX_DS02
TYPE-POOLS: rs.
*TABLES: tobj.
DATA: l_t_object TYPE rso_t_tlogo,
l_s_object TYPE rso_s_tlogo.
input parameters
initialize
DATA: l_display_log TYPE rs_bool.
IF sy-batch IS INITIAL.
l_display_log = rs_c_true.
ELSE.
l_display_log = rs_c_false.
ENDIF.
DATA: l_t_infoprov_auth TYPE rssbr_t_infoprov_auth,
l_s_infoprov_auth TYPE rssbr_s_infoprov_auth.
l_s_infoprov_auth-value = ip_v.
l_s_infoprov_auth-hierarchy = ip_h.
INSERT l_s_infoprov_auth INTO TABLE l_t_infoprov_auth.
call the function module
CALL FUNCTION 'RSSB_AUTH_GEN_FROM_INFOPROV'
EXPORTING
i_t_infoprov_auth = l_t_infoprov_auth
i_appl_log_initialized = rs_c_false
i_display_log = l_display_log
i_detlevel = '1'
i_packagesize = 10000.
*PROFILE GENERATION FAILURE ERROR TYPE IS SENT BACK TO PORTAL
PROFERRCODE = RETURN5-TYPE.
ENDFUNCTION.
Use of above function module:
This function module is used to create user ID in the system. It checks whether the user exists already, if yes, then it would send back the message for the same. If it doesnu2019t then it would create the user in system. Assign roles, profiles and authorizations for the user.
For ex: If we have 2 users XXX and YYY in that XXX is existing user and YYY is new user, letu2019s see how this function module will work for these two users
First, it uses BAPI_USER_EXISTENCE_CHECK function module to check whether the ID exists. If it exists(XXX), it would send back the message for the same. If not(YYY), it would go ahead to create the user id by the function module BAPI_USER_CREATE1. After creation of the id, message regarding the same would be sent at the end of execution of function module.
Next it will go for assigning of the roles, generation of profile and authorization to the user ID. Once the function module is finished, it would send out the message for the execution of all functionalities in the output screen.
My Requirement:
what about the internal and DUA (Delegated User Administrator) users is that covered with this function module? if not what changes required to function module?
Many thanks in advance
David
Edited by: david Rathod on Sep 24, 2010 10:11 AMHello David,
your question is really unreadable. Kindly format your question and resend.
Regards,
Satyam -
Function module for Opening Balance day wise
Hi,
I am preparing vendor ledger report for day wise .
For example : i/p fields are : Lifnr , Budat,Bukrs
O/p fields are : Opening balance ( Before the date of lifnr Closing balance ).
Debit
Credit
Closing Balance ( Opening balance + D/C).
For this Opening balance i require the function module .
Please help me .
Regards
Nandan.Hi,
My requirement is Vendor balance Report according to Posting date wise.
o/p fields are
blart budat augdt belnr openingbalance ClosingBalance Credit Debit
Credit is when schkz is 'H'.
Debit is when schkz is 'S'.
Closing Balance = Opening Balance + Credit / Debit
Regards
Nandan. -
Function Module for Excise and VAT Calculation
Dear All,
I required one Function module for calculation of Excise % and amount of Invoice Verification Document.
We are use TAXINN tax procedure. I am try to make Purchases Register where we required the Break up of Full tax amount as basic excise duty, Education Cess, S&H Education Cess and VAT Amount.
Thanks
MukeshHi,
Locks are usually appliend on Tables. So you could find the table names affecting.
Then you could goto SE11 and n Lock objects search for table name
Once you identify the lock object. Display. Goto->Lock Modules.
You will get 2 module names one for enqueue and 1 for dequeue.
e.g. Lock object EBKK_ACCNT.
and FMs are DEQUEUE_EBKK_ACCNT and ENQUEUE_EBKK_ACCNT
Hope this helps.
Regards
Megha -
Function module/BAPI for executing VD51/VD52 transactions
Hi
Warm greetings to all,
I require a function module/BAPI for executing VD51/VD52 transactions. Can anyone help on this
SreekanthHi Sreekanth,
Use this.
There is an FM which is used by standard transaction
'RV_CUSTOMER_MATERIAL_UPDATE' .
Ex Code -
CALL FUNCTION 'RV_CUSTOMER_MATERIAL_UPDATE'
IN UPDATE TASK
TABLES
XKNMT_TAB = XKNMT
YKNMT_TAB = YKNMT
TCATALOG_TAB = LT_CATALOG.
commit work.
Regards,
Vijay -
Usage of function module Material_Read
hi
Can anybody explain me how to use function module Material_Read with various necessary parameters .
You can also mail me on [email protected]
Thanx n Regards
JiteshYou check the function module by checking the function module help in SE37.
The following is the details of Function Module Material_Read
Call
CALL FUNCTION 'MATERIAL_READ'
EXPORTING SCHLUESSEL = MTCOM
IMPORTING MATDATEN = View table
RETURN = MTCOR
TABLES SEQMAT01 = Internal table
( EXCEPTIONS Material_not_found = 4
Plant_not_found = 8 . )
Exceptions statement useful only for required tables (see below).
Required tables
If a table flagged as a required table does not exist, the function module terminates at this point and issues an error message. The error message can be suppressed with the exceptions statement, in which case a return code in SY-SUBRC is given instead. In both cases (with or without EXCEPTIONS), the function module does not return any data in the event of an error. You can inactivate all required tables for the view dynamically (as a whole, not individually) by setting the flag MTCOM-NOMUS.
Return codes
If the function module ends without an error message, a return code flag can be interrogated for each table in structure MTCOR; for example, MTCOR-RMARD = X means that the function module tried to read table MARD, but did not succeed. If the flag is not set, the table was read successfully or the function module did not try to read table MARD at all (because the table is not contained in the view or because no storage location was specified).
MTCOR-LVORM
This flag is set if the object is flagged for deletion.
MTCOR-PSTAT/MTCOR-FSTAT
If you specify a maintenance status in MTCOM, for example, MTCOM-PSTAT = BDE, the system checks whether the object has been maintained by the user departments Accounting (B), Material Requirements Planning (D), and Purchasing (E). As a result:
Field MTCOR-PSTAT contains the user departments that have maintained the object; for example, MTCOR-PSTAT = B means that the object has been maintained by Accounting, but not by MRP or Purchasing.
Field MTCOR-FSTAT contains the user departments that have not maintained the object, but that could have maintained it; that is, the system checks whether the user department is allowed by the material type.
Note
This check takes time (performance). If it is not required, the function module should always be called with MTCOM-PSTAT = space.
MTCOM-NOVOR
If a plant has been specified, but no valuation level or sales organization, the function module automatically adopts (for the plant specified) the corresponding values for the valuation level and sales organization in table T001W. You can inactivate this function by setting the flag MTCOM-NOVOR.
Locking materials
If materials are locked by function module MATERIAL_READ, MATERIAL_READ_MAKF, or by other function modules of function groups MATL or MAKF, the information on which materials were already locked is buffered for performance reasons. This buffer is reset or ignored if the two indicators (MTCOM-)KZSPR and (MTCOM-)KZRFB are set. You can also use function module MATERIAL_RESET_ENQ_BUFFER or MATERIAL_RESET_ENQ_BUFFER_MAKF to completely reset this buffer. This can, for example, be necessary if function module DEQUEUE_ALL has been executed.
Parameters
SCHLUESSEL
MATDATEN
RETURN
MATPER
SEQMAT01
Exceptions
ACCOUNT_NOT_FOUND
BATCH_NOT_FOUND
FORECAST_NOT_FOUND
LOCK_ON_ACCOUNT
LOCK_ON_MATERIAL
LOCK_ON_PLANT
LOCK_ON_SALES
LOCK_ON_SLOC
LOCK_ON_BATCH
LOCK_SYSTEM_ERROR
MATERIAL_NOT_FOUND
PLANT_NOT_FOUND
SALES_NOT_FOUND
SLOC_NOT_FOUND
SLOCNUMBER_NOT_FOUND
SLOCTYPE_NOT_FOUND
TEXT_NOT_FOUND
UNIT_NOT_FOUND
INVALID_MCH1_MATNR
INVALID_MTCOM
SA_MATERIAL
WV_MATERIAL
WAART_ERROR
T134M_NOT_FOUND
Reward Points if useful.
Maybe you are looking for
-
Will not install on windows 7 x64
I get error on install on a Dell Windows 7 x64 bit laptop - trying to install the Cloud gives me the same error - There is a problem with this windows installer package A program required for this install to complete could not be run. Contact your su
-
How to read images from local hard disk and display in tile layout
Dear Folks, I have 100 images in a folder @ local hard disk (E drive). I would like to display them in Tile view of 3X3. I have options (Radio buttons) to chnage the layout at runtime to 4X4 , 5#5 and 6X6. Also when the change in layout happens, I wa
-
iPhoto automatically launches on my iMac when I connect my iPhone 5s. How can I prevent this? I'm using iPhoto 12.0.1.
-
ITunes 6.02 problem ("not enough memory error")
I attempted to update iTunes to the newest version yesterday, and for the most part everything went as planned. The application updated, everything seemed to be working afterwards. The next time I went to open iTunes I get an error of "The iTunes app
-
Changing animation in the status bar
Hi. Is it possible to change animated clock, used in SAPGUI_PROGRESS_INDICATOR function module, with another animated picture?