Updation of material data using a function module
HI
i want to update fields in the mvke table,but the field is a Customer field in the table, not sap table field.i want to update the field using a program , not going to mm02. which function can i use for the updation.There is a function module MATERIAL_MAINTAIN_DARK for updation,will this funtion module update the customer fields also. Can anyone tell me about this function module and how to use this function module or MATERIAL_MAINTAIN_DARK.
Using the function Module BAPI_MATERIAL_SAVEDATA , you can also update the custom fields.
This is the documentation for the extension fields:
<b>Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIO
Description
You use this structure to transfer the material's customer-defined
fields. For information on transferring these fields, see the function
module documentation.
Note
Besides the table fields already defined, customer-defined table fields
can also be supplied with data. Since these fields are created by the
customer, they are known only during the runtime and must therefore be
determined dynamically.
The structures BAPI_TE_<NAME> (<NAME> = MARA, MARC, MARD, MBEW, MLGN,
MLGT, MVKE) and the relevant checkbox structures BAPI_TE_<NAME> (<NAME>
= MARAX, etc.) must first be extended by the customer to include the
fields required. The standard structures contain only the corresponding
key fields. When including new fields in these structures, make sure
that the field has the same name as the field in the database table. In
addition, the fields in the structures BAPI_TE_<NAME> may only be of the
type CHARACTER. The data element BAPIUPDATE must be used for the fields
in the checkbox structure (except for key fields).
The two parameters EXTENSIONIN and EXTENSIONINX are used to transfer the
data to the method. The field STRUCTURE contains the name of the
structure (for example, BAPI_TE_MARA or BAPI_TE_MARAX) used to identify
the work area (for example, WA_BAPI_TE_MARA or WA_BAPI_TE_MARAX) to
which the data is transferred. The remaining fields for the parameter
EXTENSIONIN or EXTENSIONINX contain the data for the key fields (for
example, the material number) and the data for the customer-defined
fields. The number of characters reserved in the two parameters for the
content of a customer-defined field must be the same as the number of
characters for the corresponding work area field. If the number of
characters required is smaller, the remaining characters in the two
parameters must be filled with blanks. Only then may the content of
another field be transferred. Here too, remember that the data is
written to the database only if the corresponding indicator has been set
in the work area.</b>
Regards,
ravi
Similar Messages
-
Get purchase order doc date using BAPI function module
Hi,
I have a .net windows application that uses BAPI_PO_GETDETAIL function module to get particular details of a PO in SAP. But i am not able to get the "Doc Date" for a particular PO. I am able to get all the details of items from the table "PO_ITEMS ". I used only 1 input parameter "PURCHASEORDER".
Please help me to get this thing done
.netframework : 4.0
Language: C#
Visual Studio: vs 2010
Regards,
Manosh JacobAbsolutely hynek petrak..
Manosh Jacob You can go with the above technique. -
Update TVARV table entries using a Function Module or Program
Hi Gurus,
My requirement is that I have a entry in TVARV table which has a 'low'. We would like to change this value whenever we desire. We are unable to do it via sm30 and se16 as table maintenance access is not permitted in Production environment.
Can you please provide any Function module or program code to do it?
Requirement - User can enter a value into TVARV table by executing a function module or program
Thank you all, will award points,
PriyanshHi Priyansh,
Please refer to SAP Help for more information on variant maintenance and more specifically variable values in variants. You can use t/code STVARV for maintaining the variant variables in table TVARVC (Client-Specific Variant Variables).
Note: I suggest to use the TVARVC table instead of TVARV.
If you are looking for Function Modules in the area of Variant Maintenance, then please have a look at Function Group SVAR (t/code SE80).
If you are looking for Function Modules in the area of User Variables in Variants, then please have a look at Function Group SVUV (t/code SE80).
Furthermore, if you are looking for a program to update table TVARVC, please have a look at ABAP: Dynamic Variant Processing with STVARV.
Best eregards,
Sander -
Update sap table using a function module call by php code
Hello,
I m trying to update the table VBAP using a function module ZZ_SET_DISTANCE call by a php code.
But I have this problem:
the saprfc seems to work well but when I look to the table VBAP the fields have not been update.
I tried the function module in debug mode and it work good. The fields are update.
I also handle the saprfc call function and the return SAPRFC_OK
This are the function module ZZ_SET_DISTANCE, and the php code
//PHP CODE
$fce = saprfc_function_discover($sap,"ZZ_SET_DISTANCE");
if (! $fce ) {echo "Echec d'ouverture du module fonction "; exit;}
saprfc_import ($fce,"COMMANDE", '0000001998');
saprfc_table_init($fce,"TBLE_CMDE");
$val=array();
$val['NUM_POST']='000030';
$val['HN_EXP']='';
$val['ST_EXP']='';
$val['PC_EXP']='';
$val['CI_EXP']='';
$val['CO_EXP']='';
$val['HN_REC']='';
$val['ST_REC']='';
$val['PC_REC']='';
$val['CI_REC']='';
$val['CO_REC']='';
$val['DIST']='popo';
saprfc_table_append ($fce,"TBLE_CMDE", $val);
$rfc_rc = saprfc_call_and_receive ($fce);
echo "\n".$rfc_rc;
if ($rfc_rc != SAPRFC_OK) { if ($sap == SAPRFC_EXCEPTION ) echo ("Exception raised: ".saprfc_exception($fce)); else echo (saprfc_error($fce)); }else{echo '/execution de la function ;}
saprfc_function_free($fce);
//FUNCTION MODULE ZZ_SET_DISTANCE
FUNCTION ZZ_SET_DISTANCE.
""Local Interface:
*" IMPORTING
*" VALUE(COMMANDE) TYPE VBELN
*" TABLES
*" TBLE_CMDE STRUCTURE ZADD_COM_LOXAN
DATA : NUMC TYPE VBELN.
NUMC = COMMANDE .
WHILE STRLEN( NUMC ) < 10 .
CONCATENATE '0' NUMC INTO NUMC .
ENDWHILE .
DATA tble_addrcomm LIKE LINE OF TBLE_CMDE .
LOOP AT TBLE_CMDE INTO tble_addrcomm.
DATA : NUMP TYPE POSNR.
NUMP = tble_addrcomm-NUM_POST.
WHILE STRLEN( NUMP ) < 6 .
CONCATENATE '0' NUMP INTO NUMP .
ENDWHILE .
UPDATE VBAP SET ARKTX = tble_addrcomm-DIST
WHERE VBELN EQ COMMANDE
AND POSNR EQ NUMP.
ENDLOOP.
ENDFUNCTION.
Is anybody can help me?
thank.Marie, create a Blog please, about more details for dummies....
1) how to connect to sap system?
2) you run the php code where? in a webserver or where?
3) wich is the url for run the FM: ZZ_SET_DISTANCE
4) you placed some dlls files on the web server?
please is interesting this...
Thanks -
BOM Update using a function module - 'CSAP_MAT_BOM_MAINTAIN'
Hi,
I have problem in updating the item status for a BOM using a function module - 'CSAP_MAT_BOM_MAINTAIN'.
My goal is reset the Checkbox for 'Indicator: item relevant to production'. When i pass the value ' '[Space] to the structure field 'T_STPO-REL_PROD' it doen't work.
Do let me know if you come across such problem & what needs to passed as input to reste the checkbox in the BOM.
Thanks & Regards,
BhargavaPLM wants to manipulate the Indicators u2013 u201CBulk Materialu201D & u201CCost Relevancyu201D in BOM.
Note: The 2 indicators [u201CBulk Materialu201D & u201CCost Relevancyu201D] are interlinked with each other for a business functionlity given by SAP. So, if we try to set both indicators we get the below SAP standard error.
E 29127 Bulk material not allowed for items relevant to costing
SAP Field Name RFC Tag SAP values PLM values Meaning for SAP field
Indicator: bulk material BULK_MAT Space ! No
Indicator: bulk material BULK_MAT X X Yes
Indicator: item relevant to costing REL_COST Space ! Not relevant to costing
Indicator: item relevant to costing REL_COST 1 1 Not relevant to costing
Indicator: item relevant to costing REL_COST 2 2 Packaging operation
Indicator: item relevant to costing REL_COST 3 3 Packaging material
Indicator: item relevant to costing REL_COST X X Relevant to costing
To achieve the clear/reset/set value for 2 indicators [u201CBulk Materialu201D & u201CCost Relevancyu201D] from PLM, only eitheir of indicators status needs to sent [i.e 1 indicator status @ a time]. -
Generic data extractor using a function module
Hi All,
I want to create a generic data extractor using a function module within the BW system. i.e. the extractor will run in BW and and store the data in a cube( in BW). No R/3 is invloved. I proceeded as follows:
1. Created a structure through se11.
2. Created a function module. But while defining "E_T_DATA" in the "Tables" section of the function module, I am getting the error "TABLES parameters are obsolete". I defined as follows:
E_T_DATA TYPE ZBW_EXTRACT
ZBW_EXTRACT is the name of the structure.
What should i do in this case ?
Thanks,
SatyaHello Satya,
The message "TABLES parameters are obsolete" is just a warning and not an error. The structure of the interface is strict (defined by SAP). You should opt to proceed even if you receive the warning.
Hope this clarifies. -
How to use BAPI_MATERIAL_AVAILABILITY Function Module....
Hi Experts,
I want to know actual free available quantity (ATP Qty.) for mass materials,
How to use BAPI_MATERIAL_AVAILABILITY function module ?
I have select all material from MARA and inserted in itab.
LOOP AT ITAB.
CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'
EXPORTING
PLANT =
MATERIAL =
UNIT =
CHECK_RULE =
STGE_LOC =
BATCH =
CUSTOMER =
DOC_NUMBER =
ITM_NUMBER =
WBS_ELEM =
STOCK_IND =
DEC_FOR_ROUNDING =
DEC_FOR_ROUNDING_X =
READ_ATP_LOCK =
READ_ATP_LOCK_X =
IMPORTING
ENDLEADTME =
AV_QTY_PLT =
DIALOGFLAG =
RETURN =
TABLES
WMDVSX =
WMDVEX =
I dont know how to use it.
pl. guide us.
YusufHi,
data: iwmdvsx type table of bapiwmdvs with header line,
iwmdvex type table of bapiwmdve with header line.
parameters: p_matnr type mara-matnr,
p_werks type marc-werks,
p_meins type mara-meins.
call function 'BAPI_MATERIAL_AVAILABILITY'
exporting
plant = p_werks
material = p_matnr
unit = p_meins
CHECK_RULE =
STGE_LOC =
BATCH =
CUSTOMER =
DOC_NUMBER =
ITM_NUMBER =
WBS_ELEM =
STOCK_IND =
IMPORTING
ENDLEADTME =
AV_QTY_PLT =
DIALOGFLAG =
RETURN =
tables
wmdvsx = iwmdvsx
wmdvex = iwmdvex.
check sy-subrc = 0.
Text
ATP information
Functionality
Using this function module, you can determine the receipt quantity still available for a particular material in a certain plant according to ATP logic (MRPII).
The availability check is carried out on transferring the material number, the plant and the input table (WMDVSX). The scope of the check, that is, which stocks, receipts and issues are to be included in the check is defined by the combination of checking group (material master) and cheking rule. In the function module, the system uses the checking rule defined in Sales & Distribution (A). You can overrule this checking rule by using an interface or a user-exit (exit_saplw61v_001). A similar procedure is also valid for the plant parameters. The customer number in the user-exit means that the plant selection can be controlled via the customer. If no plant parameters are given via the interface, the system uses the parameter 'WRK' saved in the user's fixed values.
The results of the availability check are recorded in the output table (WMDVEX). This table contains dates and available receipt quantities (ATP quantities). The results of the check depends on the following entries:
If no date and no quantity is transferred, the system displays the ATP situation from today's date into the future as the result.
If only a date and no quantity is transferred, the system displays the ATP situation from the corresponding date as the result.
If both a date and a quantity are transferred, the system calculates the availability situation for the quantity specified.
In the last two cases, the parameter 'DIALOGFLAG' is supplied. This can result in the following:
' ' (blank) <=> quantity completely available
'X' <=> only partial quantity available or not available at
all
'N' <=> Material not included in the availability check
(Material not relevant to the availability check)
The system also displays the end of the replenishment lead time (ENDLEADTME).
regards -
How to use SD_VBAK_ARRAY_READ functional module
hello
can you please tell me how to use SD_VBAK_ARRAY_READ functional module. that means what i have to pass and what i should get.
Please help meHi Ravi,
i want to display vkorg,kunnr,and some other fields from the VBAK. User enters VKORG and some other fields but VKORG is compulsory.
so i written the code like this.
TYPES :BEGIN OF TEITAB_VBAK,
VKORG type VBAK-VKORG,
KUNNR TYPE VBAK-KUNNR,
VBELN TYPE VBAK-VBELN,
AUDAT TYPE VBAK-AUDAT,
VDATU TYPE VBAK-VDATU,
ERNAM TYPE VBAK-ERNAM,
END OF TEITAB_VBAK.
DATA: ITAB_VBAK TYPE TABLE OF TEITAB_VBAK,
WA_VBAK TYPE TEITAB_VBAK.
SELECT-OPTIONS: s_VKORG FOR P_VKORG OBLIGATORY, " Sales Organization
s_KUNNR FOR P_KUNNR, " Sold-to party.
s_VBELN FOR P_VBELN, " Sales Document.
s_MATNR FOR P_MATNR, " Material number.
s_AUDAT FOR P_AUDAT, " Document Date (Date Received/Sent).
s_VDATU FOR P_VDATU, " Requested delivery date.
s_ERNAM FOR P_ERNAM, " Name of Person who Created the Object.
s_VKAUS FOR P_VKAUS. " Usage indicator.
SELECT VKORG KUNNR VBELN AUDAT VDATU ERNAM
FROM VBAK
INTO CORRESPONDING FIELDS OF TABLE ITAB_VBAK
WHERE VKORG IN S_VKORG AND AUART EQ 'ZRA'.
CALL FUNCTION 'SD_VBAK_ARRAY_READ'
EXPORTING
I_BYPASSING_BUFFER = ' '
I_REFRESH_BUFFER =
TABLES
IT_VBAK_KEY =
ET_VBAK =
EXCEPTIONS
RECORDS_NOT_FOUND = 1
RECORDS_NOT_REQUESTED = 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.
ENDIF.
so i confused where to call this fucntional module and what to pass. That means call this functional module before the select query or after the select query and what to pass.
i am new in ABAP.
Please help me to solve this problem . -
Error when using CONVERT_OTF function module
Dear Friends,
In many of our reports we are using the function module CONVERT_OTF to send the output as a mail the users.
But after the latest patch update we have came across a new problem. Mail is getting triggered and we can also see the icon or
the file in mail. But when we are opening the file we are getting the message that "THERE WAS AN ERROR OPENING THIS
DOCUMENT. THE FILE IS DAMAGED AND COULD NOT BE REPAIRED.
Earlier this program has been working fine from last 2 years but after updating the patch in the of August 2009. This problem we are
facing. All our mails are not working.
Thanks
Vamshi
Edited by: Rob Burbank on Sep 7, 2009 3:12 PMDear Clemens,
Thank you for the immediate response. I have checked the program in Debug Mode. When we are passing the data to the CONVERT_OTF the output table of the function module is showing the data in some Unicode format in the tables OTF and LINES.
Out of the FM is in completely special characters and this is after updating the latest patch.
We are using Release 700 Level 19 and Service Package SAPKA70019.
Thanks and Regards
Vamshi Sreerangam
Edited by: vamshi sreerangam on Sep 8, 2009 5:54 AM -
Hi all,
when i am trying to upload the excel template by using the function module " KCD_EXCEL_OLE_TO_INT_CONVERT" to an internal table some field values are missing.
i am using the function module " KCD_EXCEL_OLE_TO_INT_CONVERT" and i am uploading an excel template and downloading that excel data into an internal table but some field values are missing while uploading the excel template and i found that the field which contains the drop down list values those values are missing.
And also when i am uploading the excel template by using the function module" KCD_EXCEL_OLE_TO_INT_CONVERT" when i am coming out of this function module one pop up is coming. how can i avoid this popup, can any one please provide me the solution thanks in advance.
FYI...it is showing the below popup screen ..
Thanks,
Koushikhi Feiyun,
below is the code(highlighted in bold)and after coming out of the function module i am getting popup and also the drop down values are missing.
DATA: ls_control TYPE zsfi_fiupload_control,
ls_header TYPE zsfi_fiupload_header_v13,
ls_item TYPE zsfi_fiupload_item_v13,
ls_trailer TYPE zsfi_fiupload_control,
l_line_count LIKE zsfi_fiupload_control-rec_count,
l_current_curr TYPE kcde_cells-value,
l_current_postdate TYPE kcde_cells-value,
l_current_compcode TYPE kcde_cells-value,
l_currentrow TYPE kcde_cells-row,
l_filename LIKE rlgrap-filename.
DATA: BEGIN OF lt_intern OCCURS 0.
INCLUDE STRUCTURE kcde_cells.
DATA: END OF lt_intern.
DATA: BEGIN OF lt_items OCCURS 0,
a TYPE kcde_cells-value,
b TYPE kcde_cells-value,
c TYPE kcde_cells-value,
d TYPE kcde_cells-value,
e TYPE kcde_cells-value,
f TYPE kcde_cells-value,
g TYPE kcde_cells-value,
h TYPE kcde_cells-value,
i TYPE kcde_cells-value,
j TYPE kcde_cells-value,
k TYPE kcde_cells-value,
l TYPE kcde_cells-value,
m TYPE kcde_cells-value,
n TYPE kcde_cells-value,
o TYPE kcde_cells-value,
p TYPE kcde_cells-value,
q TYPE kcde_cells-value,
r TYPE kcde_cells-value,
s TYPE kcde_cells-value,
t TYPE kcde_cells-value,
u TYPE kcde_cells-value,
v TYPE kcde_cells-value,
w TYPE kcde_cells-value,
x TYPE kcde_cells-value,
y TYPE kcde_cells-value,
z TYPE kcde_cells-value,
aa TYPE kcde_cells-value,
ab TYPE kcde_cells-value,
ac TYPE kcde_cells-value,
ad TYPE kcde_cells-value,
ae TYPE kcde_cells-value,
af TYPE kcde_cells-value,
ag TYPE kcde_cells-value,
ah TYPE kcde_cells-value,
ai TYPE kcde_cells-value,
AJ TYPE KCDE_CELLS-VALUE,
AK TYPE KCDE_CELLS-VALUE,
END OF lt_items.
l_filename = p_flpath.
* the file must be an xls file, not xlsx or comma seperated
IF p_flpath NS '.xls' AND p_flpath NS '.XLS'.
MESSAGE i261(zfi).
g_error = 'X'.
EXIT.
ENDIF.
* upload excel file to a generic table
CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
EXPORTING
filename = l_filename
i_begin_col = 1
i_begin_row = 1
i_end_col = 150
i_end_row = 65000
TABLES
intern = lt_intern
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 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.
ENDIF.
* validate that the format is in the restatement format
* this is the only template to have the ledger group in cell G-2
** READ TABLE lt_intern WITH KEY row = '0002' col = '0007'.
** IF sy-subrc <> 0 OR lt_intern-value IS INITIAL.
** MESSAGE i260(zfi).
** g_error = 'X'.
** EXIT.
** ENDIF.
* create control record values
ls_control-rec_type = 'C'.
ls_control-global_id = 'GLU-03000'.
ls_control-local_id = ''.
ls_control-rec_count = ''.
CONCATENATE sy-datum sy-uzeit INTO ls_control-date.
ls_control-version = '12'.
ls_control-email = ''.
ls_control-eor = 'X'.
ls_trailer = ls_control.
* open output file and add the control record
OPEN DATASET p_unixfilename FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
TRANSFER ls_control TO p_unixfilename.
* create header record values, will be transfered to file in the item loop
ls_header-rec_type = 'H'.
READ TABLE lt_intern WITH KEY row = '0017' col = '0003'.
IF sy-subrc = 0.
ls_header-header_txt = lt_intern-value.
ENDIF.
READ TABLE lt_intern WITH key row = '0020' col = '0002'.
IF sy-subrc = 0.
ls_header-comp_code = lt_intern-value.
ENDIF.
************doc date
READ TABLE lt_intern WITH KEY row = '0011' col = '0003'.
IF sy-subrc = 0.
ls_header-pstng_date = lt_intern-value.
ENDIF.
************posting date
ls_header-doc_date = sy-datum.
READ TABLE lt_intern WITH KEY row = '0009' col = '0003'.
IF sy-subrc = 0.
ls_header-doc_type = lt_intern-value.
ENDIF.
READ TABLE lt_intern WITH KEY row = '0014' col = '0003'.
IF sy-subrc = 0.
ls_header-ref_doc_no = lt_intern-value.
ENDIF.
************currency moved to line items
READ TABLE lt_intern WITH KEY row = '0020' col = '0001'.
IF sy-subrc = 0.
ls_header-currency = lt_intern-value.
ENDIF.
ls_header-trans_date = ''.
READ TABLE lt_intern WITH KEY row = '0010' col = '0003'.
IF sy-subrc = 0.
ls_header-period = lt_intern-value.
ENDIF.
READ TABLE lt_intern WITH KEY row = '0006' col = '0003'.
IF sy-subrc = 0.
ls_header-reason_rev = lt_intern-value.
ENDIF.
READ TABLE lt_intern WITH KEY row = '0007' col = '0003'.
IF sy-subrc = 0.
ls_header-rev_date = lt_intern-value.
ENDIF.
* READ TABLE lt_intern WITH KEY row = '0002' col = '0007'.
* IF sy-subrc = 0.
ls_header-ledger_grp = ''.
* ENDIF.
* READ TABLE lt_intern WITH KEY row = '0013' col = '0013'.
* IF sy-subrc = 0.
ls_header-exch_rate = ''.
* ENDIF.
READ TABLE lt_intern WITH KEY row = '0008' col = '0003'.
IF sy-subrc = 0.
ls_header-calc_tax = lt_intern-value.
ENDIF.
ls_header-eor = 'X'.
* loop at the line items and append them to a table with multiple columns
LOOP AT lt_intern WHERE row GE 20.
IF l_currentrow <> lt_intern-row AND l_currentrow IS NOT INITIAL.
APPEND lt_items.
CLEAR lt_items.
ENDIF.
l_currentrow = lt_intern-row.
CASE lt_intern-col.
WHEN '0001'. lt_items-a = lt_intern-value.
WHEN '0002'. lt_items-b = lt_intern-value.
WHEN '0003'. lt_items-c = lt_intern-value.
WHEN '0004'. lt_items-d = lt_intern-value.
WHEN '0005'. lt_items-e = lt_intern-value.
WHEN '0006'. lt_items-f = lt_intern-value.
WHEN '0007'. lt_items-g = lt_intern-value.
WHEN '0008'. lt_items-h = lt_intern-value.
WHEN '0009'. lt_items-i = lt_intern-value.
WHEN '0010'. lt_items-j = lt_intern-value.
WHEN '0011'. lt_items-k = lt_intern-value.
WHEN '0012'. lt_items-l = lt_intern-value.
WHEN '0013'. lt_items-m = lt_intern-value.
WHEN '0014'. lt_items-n = lt_intern-value.
WHEN '0015'. lt_items-o = lt_intern-value.
WHEN '0016'. lt_items-p = lt_intern-value.
WHEN '0017'. lt_items-q = lt_intern-value.
WHEN '0018'. lt_items-r = lt_intern-value.
WHEN '0019'. lt_items-s = lt_intern-value.
WHEN '0020'. lt_items-t = lt_intern-value.
WHEN '0021'. lt_items-u = lt_intern-value.
WHEN '0022'. lt_items-v = lt_intern-value.
WHEN '0023'. lt_items-w = lt_intern-value.
WHEN '0024'. lt_items-x = lt_intern-value.
WHEN '0025'. lt_items-y = lt_intern-value.
WHEN '0026'. lt_items-z = lt_intern-value.
WHEN '0027'. lt_items-aa = lt_intern-value.
WHEN '0028'. lt_items-ab = lt_intern-value.
WHEN '0029'. lt_items-ac = lt_intern-value.
WHEN '0030'. lt_items-ad = lt_intern-value.
WHEN '0031'. lt_items-ae = lt_intern-value.
WHEN '0032'. lt_items-af = lt_intern-value.
WHEN '0033'. lt_items-ag = lt_intern-value.
WHEN '0034'. lt_items-ah = lt_intern-value.
WHEN '0035'. lt_items-ai = lt_intern-value.
when '0036'. lt_items-aj = lt_intern-value.
when '0037'. lt_items-ak = lt_intern-value.
ENDCASE.
ENDLOOP.
APPEND lt_items.
* sort rows by the post date, comp code, curr.
* SORT lt_items BY ah a ai.
* loop at the items, creating a header record if the comp code, curr. or post date changes
LOOP AT lt_items.
ls_item-rec_type = 'I'.
ls_item-post_key = lt_items-c. "lt_items-b.
IF lt_items-c GE '20' AND lt_items-c LE '39'.
ls_item-vendor_no = lt_items-d.
ELSEIF lt_items-c GE '0' AND lt_items-c LE '19'.
ls_item-customer = lt_items-d.
ELSEIF lt_items-c EQ '70' AND lt_items-c EQ '75'.
ls_item-asset = lt_items-d.
ELSE.
ls_item-gl_account = lt_items-d.
ENDIF.
ls_item-asset_type = lt_items-m. "lt_items-l.
ls_item-trans_type = lt_items-n. "lt_items-m.
ls_item-print_flag = ''.
ls_item-item_text = lt_items-j. "lt_items-i.
ls_item-comp_code = lt_items-b. "lt_items-a.
ls_item-bus_area = ''.
ls_item-alloc_nmbr = lt_items-l. "lt_items-k.
ls_item-tax_code = lt_items-q. "lt_items-p.
ls_item-taxjurcode = lt_items-r. "lt_items-q.
ls_item-profit_ctr = lt_items-g. "lt_items-f.
ls_item-costcenter = lt_items-h. "lt_items-g.
ls_item-orderid = lt_items-ac. "lt_items-ab.
ls_item-wbs = lt_items-i. "lt_items-h.
ls_item-trade_id = lt_items-o. "lt_items-n.
ls_item-part_prctr = lt_items-p. "lt_items-o.
ls_item-material = lt_items-t. "lt_items-s.
ls_item-salesorg = lt_items-aa. "lt_items-z.
ls_item-distr_chan = lt_items-ab. "lt_items-aa.
ls_item-pmnttrms = ''.
ls_item-pmtmthd = ''.
ls_item-pmtmthsupl = ''.
ls_item-alt_payee = ''.
REPLACE ALL OCCURRENCES OF '(' IN lt_items-e WITH ''.
REPLACE ALL OCCURRENCES OF ')' IN lt_items-e WITH ''.
ls_item-amt_doccur = lt_items-e. "lt_items-d
REPLACE ALL OCCURRENCES OF '(' IN lt_items-f WITH ''.
REPLACE ALL OCCURRENCES OF ')' IN lt_items-f WITH ''.
ls_item-loc_amt = lt_items-f. "lt_items-e
ls_item-loc = lt_items-k. "lt_items-j.
ls_item-sas_revtype = lt_items-s. "lt_items-r.
ls_item-rev_type = lt_items-u. "lt_items-t.
ls_item-rev_chnl = lt_items-v. "lt_items-u.
ls_item-bill_to = lt_items-x. "lt_items-w.
ls_item-payer = lt_items-z. "lt_items-y.
ls_item-ship_to = lt_items-y.
ls_item-tax_amnt = lt_items-x.
ls_item-func_area = ''.
ls_item-expend_date = lt_items-ae. "lt_items-ad.
ls_item-wtax_code = lt_items-af. "lt_items-ae.
ls_item-wtax_base = lt_items-ag. "lt_items-af.
ls_item-wtax_amount = lt_items-ah. "lt_items-ag.
ls_item-payment_block = ''.
ls_item-grp_amt = ''.
ls_item-anc_amt = ''.
ls_item-permit_payee = ''.
ls_item-value_date = ''.
ls_item-pernr = ''.
ls_item-legacy1 = ''.
ls_item-legacy2 = ''.
ls_item-legacy3 = ''.
ls_item-legacy4 = ''.
ls_item-legacy5 = ''.
ls_item-legacy6 = ''.
ls_item-legacy7 = ''.
ls_item-legacy8 = ''.
ls_item-legacy9 = ''.
ls_item-legacy10 = ''.
ls_item-eor = 'X'.
TRANSLATE lt_items-ai TO UPPER CASE.
TRANSLATE lt_items-b TO UPPER CASE.
TRANSLATE lt_items-a TO UPPER CASE.
TRANSLATE lt_items-aj TO UPPER CASE.
IF l_current_curr <> lt_items-a "lt_items-ai
OR l_current_postdate <> ls_header-pstng_date "lt_items-aj
OR l_current_compcode <> lt_items-b.
l_current_curr = lt_items-a.
l_current_postdate = ls_header-pstng_date. "lt_items-aj.
l_current_compcode = lt_items-b.
ls_header-comp_code = l_current_compcode.
ls_header-currency = l_current_curr.
ls_header-pstng_date = l_current_postdate.
ls_header-doc_date = l_current_postdate.
TRANSFER ls_header TO p_unixfilename.
l_line_count = l_line_count + 1.
ENDIF.
TRANSFER ls_item TO p_unixfilename.
l_line_count = l_line_count + 1.
ENDLOOP.
ls_trailer-rec_type = 'T'.
ls_trailer-rec_count = l_line_count.
TRANSFER ls_trailer TO p_unixfilename.
CLOSE DATASET p_unixfilename.
* change the format to fixed format for the remainder of the load program
p_fixed = 'X'.
p_rstmnt = ''.
Thanks,
Koushik -
How to use read_text function module
Hi how to use read_text function module to read purchase order header text .what are all tht things to pass in ID,Name and Object
thanks,
MaheDear,
Use below code.
DATA:IT_LINE LIKE TLINE OCCURS 0 WITH HEADER LINE,
V_TDNAME LIKE THEAD-TDNAME.
V_TDNAME = PO_NUMBER.
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
ID = 'F01'
LANGUAGE = 'EN'
NAME = V_TDNAME
OBJECT = 'EKKO'
TABLES
LINES = IT_LINE.
Thanks and Regards, -
How to avoid use of function module in case of background jobs?
Hi ,
I am working a file tranfer interface .Functionality is to extract file either apllication or presentation server , and process the file through bapi , send the result in their respective server. This program should run through batch jobs in background mode.
I am using following function module :
SUBST_GET_FILE_LIS : Get the file list from application server
TMP_GUI_DIRECTORY_LIST_FILES : Get the file list from presentation server
GUI_UPLOad : to extract file data from presentation server
GUI_downLOAD : to download data to presentation server
in case of background job these function modules will not work.... so how to resolve this issue...
what are the methods we can apply?
Thanks & Regards
SandeepHi,
This FM is used to get list of files from Application server (will work in Background). This cannot be used to list files from presentation server. There is no way , by which you can process presentation server files in background mode.
Regards
Vinod -
How can i use reuse_alv_fieldcatalog_merge function module
I am using below steps for populating the final internal table.How can I use reuse_alv_fieldcatalog_merge function module in the place of declaring all these fields.How canI put title of the report in reuse_alv_fieldcatalog_merge function module.
FORM BUILD_FIELDCATALOG .
FIELDCAT-TABNAME = 'IT_FINAL'.
FIELDCAT-FIELDNAME = 'KUNNR'.
FIELDCAT-SELTEXT_M = 'Customer Name'.
FIELDCAT-JUST = 'L'.
FIELDCAT-KEY = 'X'.
FIELDCAT-DATATYPE = 'C'.
APPEND FIELDCAT TO I_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_FINAL'.
FIELDCAT-FIELDNAME = 'VBELN'.
FIELDCAT-SELTEXT_M = 'Invoice Reference'.
FIELDCAT-JUST = 'L'.
FIELDCAT-KEY = 'X'.
APPEND FIELDCAT TO I_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_FINAL'.
FIELDCAT-FIELDNAME = 'VKBUR'.
FIELDCAT-SELTEXT_M = 'Sales Office'.
FIELDCAT-JUST = 'L'.
FIELDCAT-KEY = 'X'.
FIELDCAT-DATATYPE = 'C'.
APPEND FIELDCAT TO I_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_FINAL'.
FIELDCAT-FIELDNAME = 'VKGRP'.
FIELDCAT-SELTEXT_M = 'Sales Person'.
FIELDCAT-JUST = 'L'.
FIELDCAT-KEY = 'X'.
FIELDCAT-DATATYPE = 'C'.
APPEND FIELDCAT TO I_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_FINAL'.
FIELDCAT-FIELDNAME = 'POSNR'.
FIELDCAT-SELTEXT_M = 'Item No'.
FIELDCAT-JUST = 'L'.
FIELDCAT-KEY = 'X'.
APPEND FIELDCAT TO I_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_FIANL'.
FIELDCAT-FIELDNAME = 'ARKTX'.
FIELDCAT-SELTEXT_M = 'Item Description'.
FIELDCAT-JUST = 'L'.
FIELDCAT-DATATYPE = 'C'.
APPEND FIELDCAT TO I_FIELDCAT.
CLEAR FIELDCAT.Hello,
It is very easy to use reuse_alv_fieldcatalog_merge.
You try this it will work.
example
data:
DATA : gv_repid TYPE syrepid VALUE sy-repid . " Report id
PERFORM set_field_catalog USING gst_struct CHANGING lst_fieldcat.
FORM set_field_catalog USING uv_tab TYPE slis_tabname
CHANGING xt_fieldcatalog TYPE slis_t_fieldcat_alv.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = gv_repid
i_internal_tabname = uv_tab
i_inclname = gv_repid
CHANGING
ct_fieldcat = xt_fieldcatalog
EXCEPTIONS
inconsistent_interface = 1
program_error = 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.
ENDIF.
ENDFORM. " set_field_catalog_spec -
How to keep long text in bdc using create_text function module
hi,
ihave bdc in that i having field like long text i have to upload the long text using create_text function module how to use and where to use in bdc. wat parameters i have to pass exactly.
i need some other information like how can i pass this to BDC i got like this .
can u plz check it.
its a length of 255 chaters
perform bdc_field using 'RSTXT-TXLINE(02)'
'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'
& 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'.
perform bdc_field using 'RSTXT-TXLINE(03)'
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
& 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'.
perform bdc_field using 'RSTXT-TXLINE(04)'
'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
& 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'.
perform bdc_field using 'RSTXT-TXLINE(05)'
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh'
& 'hhhhhhhhhhhhhhhhhhhhhh'.Hi,
Use this coding where do u want,
data: begin of textline occurs 10.
include structure tline.
data: end of textline.
start-of-selection.
textline-tdformat = '*'.
textline-tdline = 'TESTING FOR CREATION OF TEXT'.
append textline.
clear textline.
call function 'CREATE_TEXT'
exporting
fid = '0013'
flanguage = sy-langu
fname = '0095000501'
fobject = 'VBBK'
tables
flines = textline
exceptions
no_init = 01
no_save = 02.
end-of-selection. -
Hi experts..
i got one requirement like i need to edit some rows particularly in alv....
Edit in alv output....is it possible to get that .....using normal function module with out using oops concept...
could any one pls help me...Hi Pendurti ,
If you want a particular field to be editable , simply define the fieldcatalog as
wa_fieldcatalog-edit = 'X'.
wa_fieldcatalog-input = 'X'.
for that field.
and
Now when you use FM ' Reuse alv grid display '
define USER_COMMAND
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = int_fieldcatalog
is_layout = wa_layout
TABLES
t_outtab = t_disp.
and now in form USER_COMMAND ; code as per following
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
DATA ref1 TYPE REF TO cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref1.
CALL METHOD ref1->check_changed_data.
endform.
Regards,
Yogendra Bhaskar
Maybe you are looking for
-
My iPhone won't let me watch my video
Today, I took a video of a little boy break dancing, and it is 42 seconds long. Then, at the end of the dance, I went back to my video to watch it, and a pop up showed up and said "This movie format is not supported." Is there something wrong with my
-
Please help
-
How do I charge sales tax on shipping ONLY for Minnesota addresses?
My items are properly set up so that customers with Minnesota bill-to and/or ship-to addresses are charged MN state sales tax on the items the purchase. But according to Minnesota law, they should ALSO be charged MN sales tax on the shipping costs.
-
If viewing a pdf in safari, can you set it up so that there are controls, like in preview to jump to the next page, etc. Or do I always have to open it in preview....
-
Hello, i am getting 2 entries with this check: RMAN> report unrecoverable database; Report of files that need backup due to unrecoverable operations File Type of Backup Required Name 166 full or incremental /u01/oradata/image/datafile34.dbf 167 full