To update field using BAPI
Hello experts,
I have added one field using append structure in table MARC. I want to updated this field usnign BAPI_MATERIAL_SAVEDATA. can anybody tell me the procedure to do that?
Thanks in advance.
Hello,
Check the documentation of the function module BAPI_MATERIAL_SAVEDATA. There is a parameter in the FM - EXTENSIONIN where in new fields added to the table can be used to be updated.
The documentation of that parameters tells you how this can be achieved.
Create 2 structures of the type BAPI_TE_MARA and BAPI_TE_MARAX
Now assign the field structure of the workarea of type BAPIPAREX. Assume gs_extensionin is of type BAPIPAREX and gs_bapi_te_mara is of type BAPI_TE_MARA (this should have the fields that have been added in the table)
gs_extensionin-structure = 'BAPI_TE_MARA'.
gs_extensionin-valuepart+0(18) = gs_bapi_te_mara-matnr.
gs_extensionin-valuepart+18(length of the new field) = ga_bapi_te_mara-<new field added in the structure>.
append gs_extensionin to gt_extensionin.
gs_extensioninx-structure = 'BAPI_TE_MARAX'.
gs_extensioninx-valuepart+0(18) = gs_bapi_te_mara-matnr.
gs_extensioninx-valuepart+18(1) = 'X'..
append gs_extensioninx to gt_extensioninx.
Now pass these tables gt_extensionin and gt_extensionx to the parameters extensionin and extensioninx of the function module BAPI_MATERIAL_SAVEDATA.
Also try searching SDN using Extending BAPI's
Hope this will help in solving your query.
Regards,
Sachin
Similar Messages
-
Read from database (Access) and update fields using MS ADODB
Hello,
I am trying to get records from database using MS ADODB._connection & ADODB._Recordset objects (from LabVIEW 6)
I can:
1. open connection (with ADODB._connection)
2. write into tables (with ADODB._command)
I can not: gets records and update fields using ADODB._connection & ADODB._Recordset.
I do not know:
1. how to connect between the connection that was opened and the recordset object
2. where I can write the SQL text as input to the recordset
Attached is DataBase.llb with DB_read.vi that display my steps.
Thanks.
Attachments:
DataBase.llb 40 KBTry this one, after updating the names for database and the table you want.
Let me know if it's working.
p.s.: if you have problems, it could be a different adodb version ... but the sequence of methods is the same
Attachments:
EditdatabaseMe.vi 57 KB -
IS-RETAIL: How to update custom enhancement field using BAPI?
Hi gurus,
Like ECC BAPI: BAPI_MATERIAL_SAVEDATA,
This BAPI(BAPI_MATERIAL_MAINTAINDATA_RT) is specific for IS-RETAIL to create and update material master data.
But now If I append one custom field "ZFIELD" to end of table MARA, my question is how to update this custom enhancement field(ZFIELD) using BAPI(BAPI_MATERIAL_MAINTAINDATA_RT)
Thanks in advance!Hi DongHai,
I suggest you create your own BAPI. Just copy the codes in BAPI_MATERIAL_MAINTAINDATA_RT and add your custom fields. If you want to append the data of the custom field in table MARA, first, you have to create a structure table then goto SE11, type MARA and display. Click the APPEND STRUCTURE then choose the structure that you've created. Hope this will help.
Rewards if useful
Regards,
Mark -
Material Master: Update the Z fields using BAPI
Hi to all,
My requirement is simple. But I do not have much knowledge on BAPI. I have got some information that we can extend th BAPI and update the Z fields in material master. I have added the z fields in MARA. So when I call the bapi z fields has to get update.
Which BAPI can i use? I have got one BAPI - BAPI_MATERIAL_SAVEDATA. plz suggest me to do it.
1. how do i enhance the BAPI or extend th BAPI.
2. Is ther any approch to do it.
thnks
Yerukala SettyHi,
Append the z fields to BAPI_TE_MARA and BAPI_TE_MARAX structures using append structures.
Populate two structures for the fields in BAPI_TE_MARA and BAPI_TE_MARAX.
To BAPI_MATERIAL_SAVEDATA, under EXTENSIONIN parameters, pass structure name as BAPI_TE_MARA and Value Part1, 2, 3, 4 with the filled structure info.
Similarly append X structure as well.
Regards,
Ganga -
Update mm42 using bapi BAPI_MATERIAL_MAINTAINDATA_RT
hi everybody,
I want to update MM42 for which i have used bapi BAPI_MATERIAL_MAINTAINDATA_RT but i m not able to find out field
TARGET STOCK i, e SOBST field can any one help me out in finding target stock field in mapi kindly give the name of structure if possible.
Thankshi frndz,
first of all thanks for your quick reply.
I m looking for field SOBST in Table WRPL not the one you people are talking about.
You can find this field in MM42 under heading REPLENISHMENT PARAMETERS.
Kindly check for it. -
How to update data using BAPI for MD61
Hello,
IN my zprogram i used to bapis for uploading data from flat file to sap-system
1)BAPI_requirement_create
2)BAPI_requirement_change
i)my program is taking data from my flat file but it is wipping out old data i nned to update not to overwrite is there any BAPI for this query
ii)One more thing if data is already entered in on date (i.e 10.07.2009) and when he upload data from flat file for another date same month (12.07.2009) old date data sholud not removed ...
Please reply me if my query is not understand..
Thanks in advance..Assuming you have your new requirements in table IT_REQ.
You could do something like:
DATA: it_req TYPE TABLE OF BAPISSHDIN.
DATA: l_req TYPE BAPISSHDIN.
DATA: it_req_out TYPE TABLE OF bapisitmeo.
DATA: l_req_out TYPE bapisitmeo.
* Get existing requirements
CLEAR it_req_out[].
CALL FUNCTION 'BAPI_REQUIREMENTS_GETDETAIL'
EXPORTING
material = p_matnr
plant = p_werks
requirementstype = p_bedae
version = p_versb
reqmtsplannumber = ''
TABLES
requirements_out = it_req_out[]
return = lt_return[].
* Append old requirements to requirements table
LOOP AT it_req_out INTO l_req_out.
MOVE: l_req_out-date_type TO l_req-date_type,
l_req_out-req_date TO l_req-req_date,
l_req_out-req_qty TO l_req-req_qty,
l_req_out-unit TO l_req-unit.
APPEND l_req TO it_req.
ENDLOOP.
* Change requirements
CALL FUNCTION 'BAPI_REQUIREMENTS_CHANGE'
EXPORTING
material = p_matnr
plant = p_werks
requirementstype = p_bedae
version = p_versb
reqmtsplannumber = ''
vers_activ = p_vervs
TABLES
requirements_schedule_in = it_req[]
return = lt_return[]. -
I have a very basic table with four fields, DateReturned DueDate, daysoverdue and days. I am trying to use the following code to calculate the difference between the two dates and enter the result into days overdue. After this calculation I want to transfer only the positive values into the days field.
Calculation 1 - based on When-Button-Pressed
update test1 set daysoverdue = RETURNDATE - DUEDATE;
I can get this to work using the formula option in Property Palette - is there any way I can use an if statement. I only really want to calculate days overdue if the return date is after due date so that I have positive values only - this would avoid the need for calculation two.
Calculation two - - based on When-Button-Pressed
update test1 set days = RETURNDATE - DUEDATE
where daysoverdue >0;
When I compile and press the button - my application crashes. I can run the code via SQLPlus and it works.
What I would really like to do is the run the code automatically then the records are called up into the form. Any ideas and suggestions welcome. My PC that I am using is old and is a W2K machine with 256mb Ram and Approx 600Mhz processor.
This is my first application I am developing so if I have left out information - sorry.my small advice is , pls do not write any
insert , update or delete in forms
if you want to do that pls call a database procedure
for ex
pls call a foll procedure in when-button-pressed
trigger
dp_update_overdue;
and write the foll script in your oracle database
create or replace procedure dp_update_overdue
is
begin
update test1
set daysoverdue = returndate- duedate
where returndate > duedate;
commit;
end;
bye
pasupathy -
Hi All,
I have a udf field in OITM which we use to flag whether an item is obsolete or not, so Y or N is populated in all item records.
I am trying to copy this field and its contents to be displayed in the Stock Data Tab (OITW) using a UDF but cannot get the query to work to automatically populate this new UDF?
Any advice on the structure of the query or if I should try anything else would greatly received.
Thanks, RichardHi Richard......
Try this......
Select $[OITM.U_UDF.0]
Replace UDF with your UDF Code and apply this FMS in the UDF at OITW area and then press Shift+F2
Regards,
Rahul -
UPDATE FIELDS USING BADI INVOICE_UPDATE
I have a requirement to change item level fields based on some condition during transaction MIRO, but the BADI INVOICE_UPDATE does not have any exporting parameters and thus not allow changing the fields. So is there any other way to do it? Appreciate your help.
Thank you,
Rohit
Edited by: Julius Bussche on Mar 19, 2009 9:24 PM
Please dont use CAPS-LOCK. It is generally interpreted as SHOUTINGHi,
you could try to do something via field-symbols (but be careful):
e.g.
CONSTANTS: c_ydrseg(18) TYPE c VALUE '(SAPLMR1M)YDRSEG[]'.
DATA: wa_drseg TYPE mmcr_drseg.
CLEAR wa_drseg.
FIELD-SYMBOLS: <fs_ydrseg> TYPE table.
ASSIGN (c_ydrseg) TO <fs_ydrseg>.
CLEAR lt_drseg.
REFRESH lt_drseg.
lt_drseg[] = <fs_ydrseg>.
IF NOT <fs_ydrseg>[] IS INITIAL.
LOOP AT lt_drseg INTO wa_drseg.
* do something with EREKZ
ENDIF.
ENDIF.
Best regards -
Update field LSMNG in MIGO transaction using bapi bapi_goodsmvt_create
Hi ,
I am using bapi bapi_goodsmvt_create for creating goods receipt against purchase order in which I have to update field LSMNG i.e. Del. Note Qty. But this field is not there in BAPI input parameters/table fields.
How i can update this field using the same bapi
Thanks and regards
Deepak SharmaHi,
Can I update this field using BAPI bapi_goodsmvt_create.
thanks
Deepak -
Updating NETPR field of table EINE using BAPI
Hello All,
I have a requirement to update info record data in tables EINE, EINA, KONP. The fields to be updated are KSCHL, KBETR and NETPR. I am able to successfully update KBETR and KSCHL fields using bapi BAPI_PRICES_CONDITIONS. But I am unable to find any field in the bapi structures that would update NETPR field.
Request you to please suggest how can I update NETPR successfully in table EINE.
Thanks in advance.
AnandHi Anand,
Use the Function Module 'ME_DIRECT_INPUT_INFORECORD' to update/change the info record values.
Pass the netpr value in ls_eine structure.
To get better understanding on using this function module, please have a look on this link
Create new inforecord with standard-condition via FM
Regards,
Arun Prasath Kumar.
Edited by: Arun Prasath Kumar on Jan 17, 2011 12:09 PM -
Material Master Creation Using BAPI
Hi,
I m using BAPI_MATERIAL_SAVEDATA for Material creation using BAPI.
Now the problem is , i have created a Screen exit long back in Purchasing view.. the corresponding Z field is created in table MARC..
How can i pass value to this Z field using BAPI.
i tried with BAPI_MARC.. my Z field is not coming in that structure.
Can anyone guide me how can this be achieved.
Thanks in Advance
Aravindh ManiHi,
The Function Module BAPI_MATERIAL_SAVEDATA has the options to pass the Z fields. There exits a structure parameters
EXTENSIONIN
EXTENSIONINX
in BPAI. In EXTENSIONIN pass the data and value part you can pass in EXTENSIONINX. So this will update the Z fileds in material
master . -
How to upload material master using BAPI
I have a flat file with 3 fields MATNR,MAKTX,MEINS and I want to create material master with 2 views basic data1 & basic data2 with three fields using BAPI
Can anyone tell me how to do this only using three fields and 2 views
and also i want to know what is the exact difference between session call transaction BAPI and LSWM methods.
Thank you,
Pradeep Reddy M.Hi Pradeep Reddy Miriyala,
This a example you can use, the views are related with each table only have to adapt to your case.
Best regards
Jaime Cordeiro
*& Report ZMM01_BAPI_01 *
REPORT ZMM01_BAPI_01 .
STRUCTURE DECLARATIONS *
TABLES: BAPIMATHEAD, "Headerdata
BAPI_MARA, "Clientdata
BAPI_MARAX, "Clientdatax
BAPI_MVKE, "SalesData
BAPI_MVKEX, "SalesDatax
BAPI_MARC, "Plantdata
BAPI_MARCX, "Plantdatax
BAPI_MBEW, "ValuationData
BAPI_MBEWX, "ValuationData
BAPI_MLGN, "Storage
BAPI_MLGNX, "StorageX
BAPI_MAKT, "Material description
BAPI_MARM,
BAPI_MARMX,
bapi_mean,
BAPI_MLAN,
BAPIRET2. "Return messages
DATA: BEGIN OF LSMW_MATERIAL_MASTER,
> Initial Data
matnr(18),
mtart(4),
WERKS(4),
VKORG(4),
VTWEG(2),
LGNUM(3),"retirar
> Basic Data 1
MAKTX(40),
MEINS(3),
MATKL(9),
BISMT(18),
SPART(2),
PRDHA(18),
BRGEW(17),
NTGEW(17),
GEWEI(3),
VOLUM(13),
VOLEH(3),
EAN11(18),
NUMTP(2),
> Sales 1
DWERK(4),
TAXKM(1),
> Sales 2
KTGRM(2),
PRODH(18),
MTPOS(4),
> Sales: General/Plant
MTVFP(2),
TRAGR(4),
LADGR(4),
PRCTR(10),
> Purchasing
Novas entradas
EKGRP(3),
KAUTB(1),
XCHPF1(1),
EKWSL(4),
WEBAZ(3),
INSMK1(1),
KORDB(1),
> Foreign Trade
STAWN(17),
MTVER(4),
HERKL(3),
HERKR(3),
> Purchase Order Text View
Identificar Campos
TextoEN(100),
TextoPT(100),
TextoPL(100),
TextoES(100),
> MRP1
DISGR(4),
DISMM(2),
DISPO(3),
DISLS(2),
BSTMI(18),
BSTRF(13),
> MRP2
BESKZ(1),
RGEKZ(1),
LGPRO(4),
LGFSB(4),
EPRIO(4),
WEBAZ1(3),
PLIFZ(3),
FHORI(3),
> MRP3
PERKZ(1),
STRGR(2),
VRMOD(1),
VINT1(3),
VINT2(3),
> MRP4
ALTSL(1),
FEVOR(3),
> Work Sch
INSMK(1),
XCHPF(1),
UEETO(3),
> Plant Storage 1
MHDRZ(4),
MHDHB(4),
> Plant Storage 2
PRCTR1(10),
EPRIO1(4),
> WM 1 S01 comum a todos
LTKZA_S01(3),
LTKZE_S01(3),
LGBKZ_S01(3),
> WM 1 SHV
LTKZA_SHV(3),
LTKZE_SHV(3),
LGBKZ_SHV(3),
> WM 1 SQW
LTKZA_SQW(3),
LTKZE_SQW(3),
LGBKZ_SQW(3),
> WM 2
LHMG1(13),
LHME1(3),
LETY1(3),
LHMG2(13),
LHME2(3),
LETY2(3),
LHMG3(13),
LHME3(3),
LETY3(3),
> Accounting 1
BKLAS(4),
VPRSV(1),
VERPR(23),
PEINH(5),
END OF LSMW_MATERIAL_MASTER.
DATA:V_FILE TYPE STRING.
DATA:VolumUnitConv(3).
DATA:UnitConv(3).
INTERNAL TABLE DECLARATIONS *
*to store the input data
DATA:
BEGIN OF it_matmaster OCCURS 0.
INCLUDE STRUCTURE LSMW_MATERIAL_MASTER.
DATA:
END OF it_matmaster.
*for material description
DATA:BEGIN OF IT_MATERIALDESC OCCURS 0.
INCLUDE STRUCTURE BAPI_MAKT .
DATA:END OF IT_MATERIALDESC.
*FOR gross wt
data: begin of it_uom occurs 0.
include structure BAPI_MARM.
data:end of it_uom.
DATA: BEGIN OF IT_UOMX OCCURS 0.
INCLUDE STRUCTURE BAPI_MARMX.
DATA:END OF IT_UOMX.
data:begin of it_mean occurs 0.
include structure bapi_mean.
data:end of it_mean.
DATA: BEGIN OF it_MLAN OCCURS 0.
include STRUCTURE BAPI_MLAN.
DATA: END OF it_MLAN.
DATA:BEGIN OF IT_MLTX OCCURS 0.
INCLUDE STRUCTURE BAPI_MLTX.
DATA:END OF IT_MLTX.
*to return messages
DATA:BEGIN OF IT_RETURN OCCURS 0.
INCLUDE STRUCTURE BAPIRET2.
DATA:END OF IT_RETURN.
DATA : imat TYPE TABLE OF bapimatinr WITH HEADER LINE.
DATA: text LIKE bapi_mltx OCCURS 0 WITH HEADER LINE.
DATA: matnrAct(18),oldMart(4).
SELECTION SCREEN
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-002.
PARAMETERS:P_FILE LIKE RLGRAP-FILENAME OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1 .
AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'P_FILE'
IMPORTING
FILE_NAME = P_FILE.
TO UPLOAD THE DATA *
START-OF-SELECTION.
V_FILE = P_FILE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = V_FILE
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
IMPORTING
FILELENGTH =
HEADER =
tables
data_tab = IT_MATMASTER
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
check sy-subrc eq 0.
DATA POPULATIONS *
LOOP AT IT_MATMASTER.
IF IT_MATMASTER-MATNR EQ '' .
oldMart = IT_MATMASTER-Mtart.
CALL FUNCTION 'MATERIAL_NUMBER_GET_NEXT'
EXPORTING
MATERIALART = IT_MATMASTER-Mtart
IMPORTING
MATERIALNR = matnrAct
RETURNCODE =
EXCEPTIONS
NO_INTERNAL_INTERVAL = 1
TYPE_NOT_FOUND = 2
OTHERS = 3
if sy-subrc = 0.
BAPIMATHEAD-MATERIAL = matnrAct.
endif.
ELSE.
BAPIMATHEAD-MATERIAL = it_matmaster-matnr.
ENDIF.
Preenchimento dos dados do ecrã inicial
BAPIMATHEAD-MATERIAL = IT_MATMASTER-MATNR.
BAPIMATHEAD-IND_SECTOR = 'M'.
BAPIMATHEAD-MATL_TYPE = IT_MATMASTER-Mtart.
"declaration of views
BAPIMATHEAD-BASIC_VIEW = 'X'.
BAPIMATHEAD-MRP_VIEW = 'X'.
BAPIMATHEAD-STORAGE_VIEW = 'X'.
BAPIMATHEAD-WAREHOUSE_VIEW = 'X'.
BAPIMATHEAD-ACCOUNT_VIEW = 'X'.
If IT_MATMASTER-Mtart EQ '31'.
BAPIMATHEAD-SALES_VIEW = 'X'.
BAPIMATHEAD-WORK_SCHED_VIEW = 'X'.
ENDIF.
If IT_MATMASTER-Mtart EQ '51'.
BAPIMATHEAD-SALES_VIEW = 'X'.
BAPIMATHEAD-WORK_SCHED_VIEW = 'X'.
ENDIF.
If IT_MATMASTER-Mtart EQ '65'.
BAPIMATHEAD-PURCHASE_VIEW = 'X'.
ENDIF.
Preenchimento de dados relativos a MARA
BAPI_MARA-BASE_UOM = IT_MATMASTER-MEINS.
BAPI_MARA-MATL_GROUP = IT_MATMASTER-MATKL.
BAPI_MARA-OLD_MAT_NO = IT_MATMASTER-BISMT.
BAPI_MARA-DIVISION = IT_MATMASTER-SPART.
BAPI_MARA-PROD_HIER = IT_MATMASTER-PRDHA.
BAPI_MARA-NET_WEIGHT = IT_MATMASTER-ntgew.
BAPI_MARA-UNIT_OF_WT = IT_MATMASTER-GEWEI.
BAPI_MARA-TRANS_GRP = IT_MATMASTER-tragr.
> Novas Entradas
IF IT_MATMASTER-Mtart EQ '65'.
BAPI_MARA-BATCH_MGMT = IT_MATMASTER-XCHPF1.
BAPI_MARA-PUR_VALKEY = IT_MATMASTER-EKWSL.
BAPI_MARAX-PUR_VALKEY = 'X'.
ELSE.
BAPI_MARA-BATCH_MGMT = IT_MATMASTER-XCHPF.
ENDIF.
> Novas Entradas
BAPI_MARA-MINREMLIFE = IT_MATMASTER-MHDRZ.
BAPI_MARA-SHELF_LIFE = IT_MATMASTER-MHDHB.
BAPI_MARAX-MATL_GROUP = 'X'.
BAPI_MARAX-OLD_MAT_NO = 'X'.
BAPI_MARAX-BASE_UOM = 'X'.
BAPI_MARAX-DIVISION = 'X'.
BAPI_MARAX-PROD_HIER = 'X'.
BAPI_MARAX-NET_WEIGHT = 'X'.
BAPI_MARAX-UNIT_OF_WT = 'X'.
BAPI_MARAX-TRANS_GRP = 'X'.
BAPI_MARAX-BATCH_MGMT = 'X'.
BAPI_MARAX-MINREMLIFE = 'X'.
BAPI_MARAX-SHELF_LIFE = 'X'.
Preencimento de dados Relativos a MKVE
BAPI_MVKE-DELYG_PLNT = IT_MATMASTER-DWERK.
BAPI_MVKE-SALES_ORG = IT_MATMASTER-VKORG.
BAPI_MVKE-DISTR_CHAN = IT_MATMASTER-VTWEG.
BAPI_MVKE-PROD_HIER = IT_MATMASTER-PRODH.
BAPI_MVKE-ITEM_CAT = IT_MATMASTER-MTPOS.
BAPI_MVKE-ACCT_ASSGT = IT_MATMASTER-KTGRM.
BAPI_MVKEX-SALES_ORG = IT_MATMASTER-VKORG.
BAPI_MVKEX-DISTR_CHAN = IT_MATMASTER-VTWEG.
BAPI_MVKEX-PROD_HIER = 'X'.
BAPI_MVKEX-ITEM_CAT = 'X'.
BAPI_MVKEX-DELYG_PLNT = 'X'.
BAPI_MVKEX-ACCT_ASSGT = 'X'.
Preencimento de dados Relativos a MARC
BAPI_MARC-PLANT = IT_MATMASTER-WERKS.
BAPI_MARC-AVAILCHECK = IT_MATMASTER-MTVFP.
BAPI_MARC-LOADINGGRP = IT_MATMASTER-LADGR.
BAPI_MARC-PROFIT_CTR = IT_MATMASTER-PRCTR.
IF NOT IT_MATMASTER-Mtart EQ '51'.
BAPI_MARC-COMM_CODE = IT_MATMASTER-STAWN.
BAPI_MARC-COUNTRYORI = IT_MATMASTER-HERKL.
BAPI_MARC-REGIONORIG = IT_MATMASTER-HERKR.
BAPI_MARCX-COMM_CODE = 'X'.
BAPI_MARCX-COUNTRYORI = 'X'.
BAPI_MARCX-REGIONORIG = 'X'.
ENDIF.
BAPI_MARC-MRP_GROUP = IT_MATMASTER-DISGR.
BAPI_MARC-MRP_TYPE = IT_MATMASTER-DISMM.
BAPI_MARC-MRP_CTRLER = IT_MATMASTER-DISPO.
BAPI_MARC-LOTSIZEKEY = IT_MATMASTER-DISLS.
BAPI_MARC-MINLOTSIZE = IT_MATMASTER-BSTMI.
BAPI_MARC-ROUND_VAL = IT_MATMASTER-BSTRF.
BAPI_MARC-PROC_TYPE = IT_MATMASTER-BESKZ.
BAPI_MARC-BACKFLUSH = IT_MATMASTER-RGEKZ .
BAPI_MARC-ISS_ST_LOC = IT_MATMASTER-LGPRO.
BAPI_MARC-DETERM_GRP = IT_MATMASTER-EPRIO.
BAPI_MARC-SM_KEY = IT_MATMASTER-FHORI.
BAPI_MARC-PERIOD_IND = IT_MATMASTER-PERKZ.
BAPI_MARC-PLAN_STRGP = IT_MATMASTER-STRGR.
BAPI_MARC-CONSUMMODE = IT_MATMASTER-VRMOD.
BAPI_MARC-BWD_CONS = IT_MATMASTER-VINT1.
BAPI_MARC-FWD_CONS = IT_MATMASTER-VINT2.
BAPI_MARC-ALT_BOM_ID = IT_MATMASTER-ALTSL.
BAPI_MARC-PRODUCTION_SCHEDULER = IT_MATMASTER-FEVOR.
IF NOT IT_MATMASTER-Mtart EQ '65'.
BAPI_MARC-IND_POST_TO_INSP_STOCK = IT_MATMASTER-INSMK.
BAPI_MARC-OVER_TOL = IT_MATMASTER-UEETO.
BAPI_MARCX-IND_POST_TO_INSP_STOCK = 'X'.
BAPI_MARCX-OVER_TOL = 'X'.
ENDIF.
> Novas Entradas
IF IT_MATMASTER-Mtart EQ '65'.
BAPI_MARC-PUR_GROUP = IT_MATMASTER-EKGRP .
BAPI_MARC-AUTO_P_ORD = IT_MATMASTER-KAUTB .
BAPI_MARC-GR_PR_TIME = IT_MATMASTER-WEBAZ .
BAPI_MARC-IND_POST_TO_INSP_STOCK = IT_MATMASTER-INSMK1 .
BAPI_MARC-SOURCELIST = IT_MATMASTER-KORDB .
BAPI_MARC-EXPIMPGRP = IT_MATMASTER-MTVER .
BAPI_MARCX-PUR_GROUP = 'X'.
BAPI_MARCX-AUTO_P_ORD = 'X'.
BAPI_MARCX-GR_PR_TIME = 'X'.
BAPI_MARCX-IND_POST_TO_INSP_STOCK = 'X'.
BAPI_MARCX-SOURCELIST = 'X'.
BAPI_MARCX-EXPIMPGRP = 'X'.
ENDIF.
> Novas Entradas
BAPI_MARCX-PLANT = IT_MATMASTER-WERKS.
BAPI_MARCX-AVAILCHECK = 'X'.
BAPI_MARCX-LOADINGGRP = 'X'.
BAPI_MARCX-PROFIT_CTR = 'X'.
BAPI_MARCX-MRP_GROUP = 'X'.
BAPI_MARCX-MRP_TYPE = 'X'.
BAPI_MARCX-MRP_CTRLER = 'X'.
BAPI_MARCX-LOTSIZEKEY = 'X'.
BAPI_MARCX-MINLOTSIZE = 'X'.
BAPI_MARCX-ROUND_VAL = 'X'.
BAPI_MARCX-PROC_TYPE = 'X'.
BAPI_MARCX-BACKFLUSH = 'X'.
BAPI_MARCX-ISS_ST_LOC = 'X'.
BAPI_MARCX-DETERM_GRP = 'X'.
BAPI_MARCX-SM_KEY = 'X'.
BAPI_MARCX-PERIOD_IND = 'X'.
BAPI_MARCX-PLAN_STRGP = 'X'.
BAPI_MARCX-CONSUMMODE = 'X'.
BAPI_MARCX-BWD_CONS = 'X'.
BAPI_MARCX-FWD_CONS = 'X'.
BAPI_MARCX-ALT_BOM_ID = 'X'.
BAPI_MARCX-PRODUCTION_SCHEDULER = 'X'.
Preencimento de dados Relativos a MLGN
BAPI_MLGN-WHSE_NO = 'S01'.
BAPI_MLGN-WITHDRAWAL = IT_MATMASTER-LTKZA_S01.
BAPI_MLGN-PLACEMENT = IT_MATMASTER-LTKZE_S01.
BAPI_MLGN-STGESECTOR = IT_MATMASTER-LGBKZ_S01.
BAPI_MLGN-L_EQUIP_1 = IT_MATMASTER-LHMG1.
BAPI_MLGN-L_EQUIP_2 = IT_MATMASTER-LHMG2.
BAPI_MLGN-L_EQUIP_3 = IT_MATMASTER-LHMG3.
BAPI_MLGN-LEQ_UNIT_1 = IT_MATMASTER-LHME1.
BAPI_MLGN-LEQ_UNIT_2 = IT_MATMASTER-LHME2.
BAPI_MLGN-LEQ_UNIT_3 = IT_MATMASTER-LHME3.
BAPI_MLGN-UNITTYPE_1 = IT_MATMASTER-LETY1.
BAPI_MLGN-UNITTYPE_2 = IT_MATMASTER-LETY2.
BAPI_MLGN-UNITTYPE_3 = IT_MATMASTER-LETY3.
BAPI_MLGNX-WHSE_NO = 'S01'.
BAPI_MLGNX-WITHDRAWAL = 'X'.
BAPI_MLGNX-PLACEMENT = 'X'.
BAPI_MLGNX-STGESECTOR = 'X'.
BAPI_MLGNX-L_EQUIP_1 = 'X'.
BAPI_MLGNX-L_EQUIP_2 = 'X'.
BAPI_MLGNX-L_EQUIP_3 = 'X'.
BAPI_MLGNX-LEQ_UNIT_1 = 'X'.
BAPI_MLGNX-LEQ_UNIT_2 = 'X'.
BAPI_MLGNX-LEQ_UNIT_3 = 'X'.
BAPI_MLGNX-UNITTYPE_1 = 'X'.
BAPI_MLGNX-UNITTYPE_2 = 'X'.
BAPI_MLGNX-UNITTYPE_3 = 'X'.
Preencimento de dados Relativos a MBEW
BAPI_MBEW,
BAPI_MBEWX,
BAPI_MBEW-VAL_CLASS = IT_MATMASTER-BKLAS.
BAPI_MBEW-PRICE_CTRL = IT_MATMASTER-VPRSV.
BAPI_MBEW-STD_PRICE = IT_MATMASTER-VERPR.
BAPI_MBEW-PRICE_UNIT = IT_MATMASTER-PEINH.
BAPI_MBEW-VAL_AREA = 'CLPS'."IT_MATMASTER-BWKEY.
BAPI_MBEWX-VAL_AREA = 'CLPS'."IT_MATMASTER-BWKEY.
BAPI_MBEWX-VAL_CLASS = 'X'.
BAPI_MBEWX-PRICE_CTRL = 'X'.
BAPI_MBEWX-STD_PRICE = 'X'.
BAPI_MBEWX-PRICE_UNIT = 'X'.
---------------------------------------------------> Material Descrition
IT_MATERIALDESC-LANGU = sy-langu. "'EN'.
IT_MATERIALDESC-MATL_DESC = IT_MATMASTER-MAKTX.
APPEND IT_materialdesc.
Gross Weight, Volume and EAN
*Volume é preciso uma rotina de conversão
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
INPUT = IT_MATMASTER-VOLEH
LANGUAGE = SY-LANGU
IMPORTING
OUTPUT = VolumUnitConv
EXCEPTIONS
UNIT_NOT_FOUND = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
INPUT = IT_MATMASTER-MEINS
LANGUAGE = SY-LANGU
IMPORTING
OUTPUT = UnitConv
EXCEPTIONS
UNIT_NOT_FOUND = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IT_UOM-GROSS_WT = IT_MATMASTER-BRGEW.
IT_UOM-ALT_UNIT = UnitConv.
IT_UOM-ALT_UNIT_ISO = IT_MATMASTER-GEWEI.
IT_UOM-UNIT_OF_WT = IT_MATMASTER-GEWEI.
IT_UOM-EAN_UPC = IT_MATMASTER-EAN11.
IT_UOM-EAN_CAT = IT_MATMASTER-NUMTP.
IT_UOM-VOLUME = IT_MATMASTER-VOLUM.
IT_UOM-VOLUMEUNIT = VolumUnitConv.
IT_UOM-VOLUMEUNIT_ISO = IT_MATMASTER-VOLEH.
APPEND IT_UOM.
IT_UOMX-ALT_UNIT = IT_MATMASTER-MEINS.
IT_UOMX-ALT_UNIT_ISO = IT_MATMASTER-GEWEI.
IT_UOMX-GROSS_WT = 'X'.
IT_UOMX-UNIT_OF_WT = 'X'.
IT_UOMX-EAN_UPC = 'X'.
IT_UOMX-EAN_CAT = 'X'.
*Volume
IT_UOMX-VOLUME = 'X'.
IT_UOMX-VOLUMEUNIT = 'X'.
IT_UOMX-VOLUMEUNIT_ISO = 'X'.
APPEND IT_UOMX.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = BAPIMATHEAD
CLIENTDATA = BAPI_MARA
CLIENTDATAX = BAPI_MARAx
PLANTDATA = BAPI_MARc
PLANTDATAX = BAPI_MARcx
VALUATIONDATA = BAPI_MBEW
VALUATIONDATAX = BAPI_MBEWX
WAREHOUSENUMBERDATA = BAPI_MLGN
WAREHOUSENUMBERDATAX = BAPI_MLGNX
SALESDATA = BAPI_MVKE
SALESDATAX = BAPI_MVKEX
IMPORTING
RETURN = IT_RETURN
TABLES
MATERIALDESCRIPTION = IT_MATERIALDESC
UNITSOFMEASURE = IT_UOM
UNITSOFMEASUREX = IT_UOMX
MATERIALLONGTEXT = text
TAXCLASSIFICATIONS = it_MLAN.
if it_return-type eq 'S'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
endif.
WAIT UP TO 10 SECONDS.
WRITE : / IT_RETURN-MESSAGE.
CLEAR: IT_MATERIALDESC[],
IT_UOM[],
IT_UOMX[],
it_MLAN[],
IT_RETURN,
text,
BAPIMATHEAD,
BAPI_MARA,
BAPI_MARAx,
BAPI_MARc,
BAPI_MARcx,
BAPI_MBEW,
BAPI_MBEWX,
BAPI_MLGN,
BAPI_MLGNX,
BAPI_MVKE,
BAPI_MVKEX
ENDLOOP. -
Update Behavior using Multiple tables
I'm trying to use the Update behavior from Dreamweaver MX2004
to update fields from diferent joined tables. The search form works
OK as I joined the tables and I get great results (see SQL Query
below). When I try to create link to a detail page from the master
page and I use the same recordset as below and I use the update
behavior, I can only choose a table at the time to update fields
using only one key. If I choose only one table and pass one key
field is OK but I need to update all three joined tables. Is there
a way to do something like this in the Link field in the master
page calling the detail page? Is there is a correct way to pass the
three keys from the master page to the detail page? I'm using ASP
and standard SQL. The environment is Windows for testing and SQL
server.
Detail Page Parameters (not sure if this could be done):
details_Admin_Skill_Resource.asp?resourceSkillMapID=
<%=(Recordset1.Fields.Item("resourceSkillMapID").Value)%>?<%=(Recordset1.Fields.Item("skil lID").Value)%>?<%=(Recordset1.Fields.Item("resourceId").Value)%>
I'm also inserting hidden fileds in the detail form. Any
Ideas how to update several tables in DW MX2004 with the update
behavior?
This is the query in the recordset and it is working OK as it
produces results from the search page. What modifications I need to
do to this recordset in the update page?
Thank you for your help!!!
Carlos Melendez
[email protected]
This is what I typed in the advanced SQL box in the
recordset.
SELECT
ResourceSkillMapping.resourceSkillMapID,ResourceSkillMapping.skillID,ResourceSkillMapping .competenceLevel,skill.skillname,resource.resourceName,resource.resourceLoginId,resource.r esourceId,resource.profileId,resource.resourceGroupID,resource.resourceType,resource.activ e,resource.autoAvail,resource.extension,resource.orderInRG,resource.dateInactive,resource. assignedTeamID,resource.resourceFirstName,resource.resourceLastName
FROM ResourceSkillMapping INNER JOIN Skill ON
ResourceSkillMapping.skillID = Skill.skillID INNER JOIN Resource ON
ResourceSkillMapping.resourceSkillMapID =
Resource.resourceSkillMapID
WHERE (Resource.resourceLoginID LIKE '%Agent_asp%') AND
(Resource.active = 1)
Variables
Skill_asp for skillName
Agent_asp for resourceLoginID
Default value of variables is 1 to display all records
Runtime
Request.QueryString("skillname")
Request.QueryString("resourceLoginID")ITCoreTeam wrote:
> I'm trying to use the Update behavior from Dreamweaver
MX2004 to
update fields
> from diferent joined tables. The search form works OK
as I joined the
tables
> and I get great results (see SQL Query below). When I
try to create
link to a
> detail page from the master page and I use the same
recordset as
below and I
> use the update behavior, I can only choose a table at
the time to
update fields
> using only one key. If I choose only one table and pass
one key field
is OK but
> I need to update all three joined tables. Is there a
way to do
something like
> this in the Link field in the master page calling the
detail page? Is
there is
> a correct way to pass the three keys from the master
page to the
detail page?
> I'm using ASP and standard SQL. The environment is
Windows for
testing and SQL
> server.
> Detail Page Parameters:
> details_Admin_Skill_Resource.asp?resourceSkillMapID=
>
>
<%=(Recordset1.Fields.Item("resourceSkillMapID").Value)%>?<%=(Recordset1.Fields.
>
Item("skillID").Value)%>?<%=(Recordset1.Fields.Item("resourceId").Value)%>
>
> I'm also inserting hidden fileds in the detail form.
Any Ideas how
to update
> several tables in DW MX2004 with the update behavior?
>
>
> This is the query in the recordset and it is working OK
as it
produces results
> from the search page. What modifications I need to do
to this
recordset in the
> update page?
>
>
> Thank you for your help!!!
> Carlos Melendez
> [email protected]
>
> This is what I typed in the advanced SQL box in the
recordset.
> SELECT
>
>
>
ResourceSkillMapping.resourceSkillMapID,ResourceSkillMapping.skillID,ResourceSki
>
llMapping.competenceLevel,skill.skillname,resource.resourceName,resource.reso
>
>
>
urceLoginId,resource.resourceId,resource.profileId,resource.resourceGroupID,reso
>
urce.resourceType,resource.active,resource.autoAvail,resource.extension,resou
>
>
>
rce.orderInRG,resource.dateInactive,resource.assignedTeamID,resource.resourceFir
> stName,resource.resourceLastName
> FROM ResourceSkillMapping INNER JOIN Skill ON
ResourceSkillMapping.skillID =
> Skill.skillID INNER JOIN Resource ON
ResourceSkillMapping.resourceSkillMapID =
>
> Resource.resourceSkillMapID
> WHERE (Resource.resourceLoginID LIKE '%Agent_asp%') AND
(Resource.active = 1)
> OR (Skill.skillName LIKE '%Skill_asp%')
>
> Variables
> Skill_asp for skillName
> Agent_asp for resourceLoginID
>
> Default value of variables is 1 to display all records
>
> Runtime
> Request.QueryString("skillname")
> Request.QueryString("resourceLoginID")
>
One solution is to create a view in SQL, that is exactly the
same as
your SELECT above. You then use the view name instead of the
table name
in your UPDATE statement. I know in the SQL world that this
is possible,
but I don't know if the Dreamweaver update behaviour will see
the views
stored on your SQL server.
Steve -
Customer's field using BAPI_SLSTRANSACT_CREATEMULTI
Hi,
Can someone tell me how to populate customer's fields using BAPI BAPI_SLSTRANSACT_CREATEMULTI'.I have used EEW and it has extended the structure 'CRMT_CUSTOMER_H_COM' but did not extend sructure'BAPIBUS20001_CUSTOMER_H'. So I cannot pass the value.
Tried to extend 'BAPIBUS20001_CUSTOMER_H' using SE11 but its enhancement category is set to 'Can not be enhanced'.
Thanks for any suggestionHi Sudesh,
I think you did not do the enhancement properly in EEWB.
Just do one thing. Copy the code if you have written any in the EEWB for the enhancement somewhere. Run the EEWB wizard again and regenerate the project. Now paste the code that you had written earlier.
Use the BAPI_BUSPROCESSND_CREATEMULTI and populate the fields as below:
DATA: lv_header_guid TYPE crmt_object_guid,
lv_item_guid TYPE crmt_object_guid,
lit_inputfields TYPE TABLE OF
bapibus20001_input_fields,
wa_inputfields LIKE LINE OF lit_inputfields,
lit_customer_h TYPE TABLE OF
bapibus20001_customer_h,
wa_customer_h LIKE LINE OF lit_customer_h,
lit_header TYPE TABLE OF
bapibus20001_header_ins,
wa_header LIKE LINE OF lit_header,
lit_orderadm_i TYPE TABLE OF bapibus20001_item,
wa_orderadm_i LIKE LINE OF lit_orderadm_i.
* Fill the HEADER
* Create Contract header guid
CALL FUNCTION 'GUID_CREATE'
IMPORTING
ev_guid_16 = lv_header_guid.
* Fill orderadm_h
wa_header-guid = lv_header_guid.
wa_header-process_type = 'ZIUS'.
APPEND wa_header TO lit_header.
* Fill input fields
MOVE: lv_header_guid TO wa_inputfields-ref_guid,
'A' TO wa_inputfields-ref_kind,
'ORDERADM_H' TO wa_inputfields-objectname,
'PROCESS_TYPE' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
CLEAR wa_inputfields.
* Customer Fields at HEADER Level
MOVE lv_header_guid TO wa_customer_h-ref_guid.
MOVE 'A' TO wa_customer_h-mode.
MOVE: lv_terms TO wa_customer_h-zzcustomer_h0305,
gv_sales_ch TO wa_customer_h-zzcustomer_h0301,
gv_sales_type TO wa_customer_h-zzcustomer_h0302,
gv_reference TO wa_customer_h-zzcustomer_h0313,
gv_creditrate TO wa_customer_h-zzcustomer_h0311.
APPEND wa_customer_h TO lit_customer_h.
* Fill input fields
MOVE: lv_header_guid TO wa_inputfields-ref_guid,
'A' TO wa_inputfields-ref_kind,
'CUSTOMER_H' TO wa_inputfields-objectname.
MOVE 'ZZCUSTOMER_H0305' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
MOVE 'ZZCUSTOMER_H0301' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
MOVE 'ZZCUSTOMER_H0302' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
MOVE 'ZZCUSTOMER_H0313' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
MOVE 'ZZCUSTOMER_H0311' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
MOVE 'MODE' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
CLEAR wa_inputfields.
* Fill the Item(ORDERADM_I)
CALL FUNCTION 'GUID_CREATE'
IMPORTING
ev_guid_16 = lv_item_guid.
* Fill ORDERADM_I
MOVE: lv_item_guid TO wa_orderadm_i-guid,
'A' TO wa_orderadm_i-mode,
gv_product TO wa_orderadm_i-ordered_prod,
lv_header_guid TO wa_orderadm_i-header.
* Fill input fields
MOVE: lv_item_guid TO wa_inputfields-ref_guid,
'B' TO wa_inputfields-ref_kind,
'ORDERADM_I' TO wa_inputfields-objectname.
MOVE 'ORDERED_PROD' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
MOVE 'PRODUCT' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
MOVE 'MODE' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
CLEAR wa_inputfields.
* Customer fields at ITEM Level
* Similarly fill the values for enahanced fields in
* lit_customer_i and also the respective input fields in
* lit_inputfields
* Fill the rest of the internal tables in the same way
* Partner, Status, Object, Appointment etc.
* Now call the BAPI
CALL FUNCTION 'ZBAPI_CONTRACT_CREATEMULTI'
TABLES
header = lit_header
item = lit_orderadm_i
partner = lit_partner
organisation = lit_organisation
status = lit_status
appointment = lit_appointment
input_fields = lit_inputfields
return = lit_ret
product = lit_product
scheduleline = lit_schline
customer_head = lit_customer_h
customer_item = lit_customer_i
pricing = lit_pricing
condition_create = lit_condition
billing = lit_billing
config_cfg = lit_config_cfg
config_ins = lit_config_ins
config_val = lit_config
OBJECTS = lit_object.
<b>Reward points if it helps.</b>
Maybe you are looking for
-
Hp laserjet pro p1102w driver for windows RT
Dear All I just bought Dell Tablet XPS10 tablet notebook with Window RT cant install HP laserjet pro P1102w. on it pls advise if some one ahve the solution
-
Mac Mini wont' Display Sleep after Yosemite Update
My Mac Mini is no longer going into Display Sleep. Instead I now see the Screen Saver. I have checked System Preferences | Energy Saver and it is definitely set to Display Sleep after 10 minutes (The default). What is interesting is that if I try to
-
Problems printing to PDF from PPT 2K7
Hi All, I am wondering if someone here can help me. I have a user that is having an issue printing to Adobe PDF from Powerpoint 2007. He can save the file as a PDF but wants to print it so he can get a better resolution. Office 2007 is installed on a
-
I know this sounds crazy but I recently installed an Airport express and an Airport Extreme, I worked on it for several days and everything seemed to finally working like it should using manual configurations so it is all right as far as function goe
-
Meet The Experts Questions: Partnering ISV Forum / J2EE Migration
Hi SDN Members, In Walldorf we are having Meet the Expert sessions, where SAP developers will answer your questions to a particular topic. <b>SDN Meets Labs Walldorf Agenda</b>: https://www.sdn.sap.com/sdn/index.sdn?page=sdnmeetslabs_walldorf_agenda.