Activity relation using bapi bapi_network_maintain
hi gurus,
i wrote a upload program to create relation between the activities using the bapi bapi_networ_maintain .
I used refnumber Objecttype method object key
000001 NetworkRelation CREATE FS0000600001610280
000000 save
for i_method_project table
object key is formed with the combination of
wa_tab-relation_type wa_tab-net_pd wa_tab-activity_predecessor
wa_tab-net_sc wa_tab-activity_successor INTO w_objkey
here in my program objectkey value is obtained from the bellow values.
wa_tab-relation_type value is 'FS'
wa_tab-net_pd VALUE is empty (there is no value for this field in excel sheet)
wa_tab-activity_predecessor value is ' 000060000161'
wa_tab-net_sc value is empty ((there is no value for this field in excel sheet)
wa_tab-activity_successor value is ' 0280'
when i run the program I am getting the bellow error ..........
An incorrect object key was entered for object type Relationship
kindly sugest the solution for my problem.
thanks in advance,
padmaja.
Hi ,
I think there is some error in the code written as you have mentioned that
object key is formed with the combination of
wa_tab-relation_type wa_tab-net_pd wa_tab-activity_predecessor
wa_tab-net_sc wa_tab-activity_successor INTO w_objkey
but as per the documentation found for this particular BAPI ( bapi_network_maintain ) ,
there should be only 1 object type , and can be a single network .
Please look into the documentation by opening this BAPI in system and try to write the program as per the rules.
May your problem get resolved .
And I suggest you to post this thread to Abap Forum , and there you can get the exact solution.
Thanks ,
Dhruv Kumar Malhotra
Edited by: Dhruv Kumar Malhotra on Aug 4, 2009 8:30 AM
Similar Messages
-
Error while creating activity by using BAPI
Hi,
While creating activity by using BAPI Im getting error as follows,
Start processing of refference object handle generated.
Integrity rule a d0008 broken
business partner with function from vbkakom not vbpakom
Integrity rule a d0008 broken
edit all incomplete field .
Please help me for solving this issue.
Regards,
SureshNot received any proper reply Closing the issue.
-
How to create Incoming Email Activity using BAPI or Function module
To create an Incoming Email Activity using BAPI 'BAPI_ACTIVITYCRM_CREATEMULTI' or using 'CRM_ORDER_MAINTAIN' . what parameters i need to pass to a bapi.
Suggest me with a solution.
Regards,
SanjaniFor activity you must fill the following structures of 'CRM_ORDER_MAINTAIN'...
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
EXPORTING
it_activity_h = t_activity_h
iv_collect_exceptions = ''
CHANGING
ct_orderadm_h = t_orderadm_h
ct_input_fields = t_input_fields
EXCEPTIONS
error_occurred = 1
document_locked = 2
no_change_allowed = 3
no_authority = 4
OTHERS = 5.
And at the end you must use also 'CRM_ORDER_SAVE' to performe the save.
Regards. -
How to get Default Activity(Infotype 0315) using BAPI
Hi Everyone,
I have a task to get Default Activity by Personal number for my third party application. Unfortunately function HR_READ_INFOTYPE is not allowed for Remote Call.
Is there any simple way how to get this value from system using BAPI? E.e. using RFC_READ_TABLE function(but i don't know table name ).
Thanks,
Roman.Table -> PA0315 Field ->LSTAR (Activity Type)
Class :CL_HRPT_INFOTYPE_0315
You can also use FM "CATS_GET_INFOTYPE_0315" RFC Enable
Good luck !
~Saquib -
Hi experts, Upload purchase order using BAPI
hi
Could you please help me how to do PURCHASE ORDER CREATION using BAPI.
Thank you.Satyendra,
The forum that you have posted your question in is for questions related to the SAP Business One Integration for SAP NetWeaver. Your question is or seems to be related to R/3 and should be posted in that forum.
Eddy -
Hi bapi Guru's,
I am asked to use bapi's(Instead of BDC's) for data upload .I am not getting good documentation on 'USING BAPI's IN ABAP',Like Defining structures, and what are the FM's to be called like bapi_commit.
Any Info is Appriciated.
Regards
satishSorry Satish,
Maybe this is going off topic a little, bit perhaps also its relevant as you have been asked to move from BDC's to BAPIs.
Juan,
When I talk about debugging, there are two levels to this:
<b>1. Debugging by the programmer</b>
In this case, how can it be easier to debug an error from a BAPI than from the screen? For a sales order, for example, when you enter a delivery date of 01.01.2000 for an item, via BDC you will get an error message as the item is entered (something along the lines of delivery date is in the past), and you will see exactly the date you have entered, and if you don't understand the error, you can click on F1 and it will give you the long description of the error. Via a BAPI, you would get the error message, and you MIGHT get the item number and the date in question. But if you don't understand the error what do you do then? Debug the BAPI itself? You could, but isn't this a rather lengthy way to get to the root of the problem? In general, any errors you get calling BAPIs/BDCs are errors with your master data, or breaking business rules, you shouldn't have to debug standard code to tell you whats going wrong, the application can tell you.
<b>2. Debugging by the end user</b>
When you implement a BAPI/BDC this will be related to an interface/automated transaction etc. When its in production you will occassionally get errors (due to bad master data, not fully capturing all the business logic in your custom coding [it happens], technical issues etc.) What do you do then? In the case of BDC you can do nothing. The error is recorded, and you can get end users to process the errors by stepping through the screens (which they already know how to use) and make corrections as required. In the case of BAPIs, you have to record the error in a table or a file, then develop some kind of interface to display the errors, then develop some kind of process for re-processing the errors. If the data used to call the BAPI is not correct then you also need to provide a facility for changing the data before reprocessing. Normally you do none of this because its too much work and you end up having all errors coming back to the SAP team who have to debug and change table entries etc. to get it all to work. I would not say that this makes BAPIs easier to debug.
Oops, just realised my pasta is burning!!!
Anyway, think I got my point across. Not personal but feel quite strongly about this topic. To me BDC's are still a relevant tool despite the push for Idocs/BAPIs.
Cheers,
Brad -
Error while updating AFS weights & measures material master data using BAPI
Hello ABAP experts,
Please help me in finding the right way in updating AFS weights & measures data (/AFS/MARM) data using BAPI /AFS/BAPI_MATERIAL_SAVE_DATA.
I'm populating the following table parameters of the BAPI,
1. SKUUNITSOFMEASURE with /AFS/MARM records
s_bapi_marm-ALT_UNIT = 'EA'.
s_bapi_marm-ALT_UNIT_ISO = 'EA'.
s_bapi_marm-grid_value = 'XXXXS'.
*s_bapi_marm-STOCK_CATEGORY = '01000'.
s_bapi_marm-volume = '10'.
s_bapi_marm-GROSS_WT = '10'.
s_bapi_marm-NET_WEIGHT = '10'.
append s_bapi_marm to t_bapi_marm.
2. UNITSOFMEASURE with MARM records
s_bapi_uom-ALT_UNIT = 'EA'.
s_bapi_uom-ALT_UNIT_ISO = 'EA'.
s_bapi_uom-NUMERATOR = '1'.
s_bapi_uom-DENOMINATR = '1'.
s_bapi_uom-UNIT_OF_WT = 'KG'.
s_bapi_uom-VOLUMEUNIT = 'CCM'.
append s_bapi_uom to t_bapi_uom.
But the BAPI returns me an error "Stock Category & is not valid in Category structure &"
Let me know if you have any inputs on this one.
Thanks,
Partha.Hi VAMSHI,
I have your same error but I don't know how to solve it. We have active "material split valuation" and valuation type is mandatory field if using ACCOUNTING and COSTING views.
Please, let me know.
Thanks in advance.
GB -
Issue while changing activity partner in BAPI BAPI_ACTIVITYCRM_CHANGEMULTI
Hi,
I'm trying to change 'Activity Partner' for an activity using BAPI BAPI_ACTIVITYCRM_CHANGEMULTI. But the function module is giving me an error 'Document could not be saved.'. I'm already calling BAPI_ACTIVITYCRM_SAVE BAPI_TRANSACTION_COMMIT after the main BAPI.
Can someone help me? Any help would be highly appreciated.
Here are the parameters I'm filling for the above BAPIs.
BAPI_ACTIVITYCRM_CHANGEMULTI
lt_header-guid = t_tgtact-act_guid.
lt_header-object_id = t_tgtact-act_no_crm.
lt_header-mode = 'B'. "Change
lt_headerx-guid = c_x.
lt_headerx-object_id = c_x.
lt_header-mode = c_x.
lt_partner-ref_guid = <original BP guid>
lt_partner-ref_kind = 'A'.
lt_partner-ref_partner_handle = '0001'.
lt_partner-ref_partner_fct = '00000009'. "Act part
lt_partner-partner_fct = '00000009'. "Act part
lt_partner-partner_no = <new BP no>.
lt_partner-no_type = 'BP'."bus. partner no
lt_partner-display_type = 'BP'."bus. partner no
lt_partnerx-ref_guid = c_x.
lt_partnerx-ref_kind = c_x.
lt_partnerx-ref_partner_handle = c_x.
lt_partnerx-ref_partner_fct = c_x.
lt_partnerx-partner_fct = c_x.
lt_partnerx-partner_no = c_x.
lt_partnerx-no_type = c_x.
lt_partnerx-display_type = c_x.
BAPI_ACTIVITYCRM_SAVE
lt_objtosave-guid = <act_guid>
lt_objtosave-OBJECT_TYPE = 'BUS2000126'.Hi Vivek,
Thanks for the reply. I have made the changes. Could you please see the code below? I believe that the parter and partnerx table will only have one entry each.
Please let me know if I'm doing something wrong here. Thanks!
Header -
lt_header-guid = t_tgtact-act_guid.
lt_header-handle = '0001'.
lt_header-mode = 'B'. "Change
lt_headerx-guid = c_x.
lt_headerx-handle = c_x.
lt_headerx-mode = c_x.
Reference -------------------------------*
lt_partner-ref_guid = t_tgtact-act_guid.
lt_partner-ref_kind = 'B'.
lt_partner-ref_handle = lt_header-handle.
lt_partnerx-ref_guid = c_x.
lt_partnerx-ref_kind = c_x.
lt_partnerx-ref_handle = c_x.
Reference Partner ---------------------------*
lt_partner-ref_partner_handle = '0002'.
lt_partner-ref_partner_fct = c_parfn_actbp.
lt_partner-ref_partner_no = t_tgtact-bpno.
lt_partner-ref_no_type = 'BP'.
lt_partner-ref_display_type = 'BP'.
lt_partnerx-ref_partner_handle = c_x.
lt_partnerx-ref_partner_fct = c_x.
lt_partnerx-ref_partner_no = c_x.
lt_partnerx-ref_no_type = c_x.
lt_partnerx-ref_display_type = c_x.
New Partner ---------------------------*
lt_partner-partner_fct = c_parfn_actbp.
lt_partner-partner_no = t_tgtact-tgt_bpno.
lt_partner-no_type = 'BP'.
lt_partner-display_type = 'BP'.
lt_partnerx-partner_fct = c_x.
lt_partnerx-partner_no = c_x.
lt_partnerx-no_type = c_x.
lt_partnerx-display_type = c_x.
Object to Save -
lt_objtosave-guid = t_tgtact-act_guid.
lt_objtosave-object_type = 'BUS2000126'.
append: lt_header, lt_headerx.
append: lt_partner, lt_partnerx.
append: lt_objtosave. -
Kindly help reg - LSMW using BAPI
Hi All,
I am using LSMW using BAPI method to upload data to create an Purchase order. I m getting this error.
" Identification specifications missing for source structure 'PSOURCE_HEAD' ".
Here are the steps I have followed.
1. Created an IDOC Inbound Processing.
2. Bussiness Object: BUS2012
Method : CreateFromData
Message Type : PORDCR
Basic Type : PORDCR05
3. Maintained Source Structure : PSOURCE_HEAD AND PSOURCE_ITEM
4. Maintained Source Fields for PSOURCE_HEAD AND ITEM
5. Maintained Structure Relations:
E1PORDCR=>PSOURCE_HEAD
E1BPEKKOC=>PSOURCE_HEAD
E1BPEKOC=>PSOURCE_ITEM
E1BPEKET=>PSOURCE_ITEM
6. MAINTAINED FIELD MAPPING:
E1PORDCR - E1PORDCR-HEAD_ADD_DATA_RELEVANT = 'H'.
E1PORDCR - E1PORDCR-ITEM_ADD_DATA_RELEVANT = 'I'.
7. specify files
8. Assign Files : assigned uploaded file to both PSOURCE_HEAD AND PSOURCE_ITEM
9. IMPORT DATA: I M GETTING THE PROBLEM " Identification specifications missing for source Structure 'PSOURCE_HEAD' ".
H 1001 1000 000
I 100-130 20 200 001 1000 28.06.2006
With Regards
VasuHi vasu
I have encountered the same problem with material BOM creation.
The reason you get this message is probably because you didn't define correctly the identification field in the source structures.
In step 'Maintain source fields' you should define the first field of every structure as identification field by creating char field of length 1. Then from the tree view of source fields, double click this field (in change mode) and give appropriate value in field 'Identifying Field Content', meaning 1 for header structure, 2 for items structure etc.
This should fix the problem.
Best regards -
F-22, Need to upload the document using BAPI
we have requirement to use BAPI for uploading document to f-22,
For the BAPI when we input data all the data are correctly posted except posting keys,
Our requirement is to use the customized posting for crediting customer and standard posting key for debiting GL account,
We have input the required posting key in BAPI but still its not picking the posting key, its taking the standard posting key,
Document type used is DC and DB,
so is there any relation between document type and posting key, any idea from where BAPI is picking Posting key?Hello,
it was originally not intended to use the BAPI to post
payment documnents. For simplicity the posting keys are not
at the BAPI's interface, instead they are defaulted with
the standard posting keys depending on account type and debit/credit
indicator.
Please see note 487722 which explains how to pass addditional data
to the BAPI in parameter EXTENSION1. You can implement the
Business Transaction Event (BTE) RWBAPI01 to populate the posting
key (t_accit-bschl) from EXTENSION1 parameter.
I hope this helps!
BR,
Raquel -
Closing Purchase order using BAPI : BAPI_PO_CHANGE
Hi ABAPers,
I have a requirement to develope a new report program which should accept a file which contains a list of PO and related Line Items to be closed. Basically the u201CDelivery completedu201D (EKPO-ELIKZ) check-box should be ticked and the PO should be saved.
I know I have to use BAPI: BAPI_PO_CHANGE.
But I am not aware how the parameters of this BAPI is populated.
Please let me know how to populate the parameters of this BAPI in order to Close the list of POs from file.
Input for this BAPI - I have only PO number, item number.
Thanks,
~Sachin>
Sachin Dandekar wrote:
> Hi all,
>
> Now I am able to close the PO using BAPI BAPI_PO_CHANGE.
>
> Here I have one requirement to stop triggering messages while closing PO.
> Please tell me how to stop triggering of output type if I close PO using this program.
>
> Thanks,
> ~Sachin
check parameter to BAPI
NO_MESSAGING = 'X' -
why we have to create PARTNER PROFILE while using BAPI in LSMW , and what is the correct way to create that
Hi
Partner Profile creation is not linked with LSMW or BAPI
it is linked with ALE,EDI, IDOC
we create partner profiles using WE20 tcode
and we define Inbound, Outbound paramters related to Idoc data transmission
<b>Reward points for useful Answers</b>
Regards
Anji -
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. -
Data tranfer using bapi(lsmw)
please explain the steps that are used to upload legacy data into sap using lsmw (bapi method)
Message was edited by:
neela renganathanHi,
is step by step process .
Step-by-Step Guide for using BAPI in LSMW
Note! The screen prints in this article are from ECC 5.0. They may differ slightly in other versions.
Introduction:
This document details the usage of BAPI in LSMW. We have used the example of migration of the purchase order data into SAP.
Pre-requisites:
It is assumed that the reader of this article has the minimum knowledge required on the Business Object, BAPI, Message Types and IDoc Types.
Step-by-Step Procedure:
Details of the BAPI used in this scenario:
Business Object: BUS2012
Method: CreateFromData
Details of Message Type and Basic IDoc Type:
Message Type: PORDCR
Basic IDoc Type: PORDCR02
Lets have a look at the BAPI first, before proceeding to the LSMW:
1. Go to Transaction BAPI
2. Click on Search Button
3. Enter the value BUS2012 and select Obj.type(Technical Object Name
4. Press ENTER
5. Following screen appears:
6. On the left side of the screen, Expand the PurchaseOrder.
7. Select PurchaseOrder and double-click on the same for details.
Building LSMW using BAPI:
1. Go to Transaction LSMW.
2. Enter the Project, Subproject and Object information and click on CREATE.
3. Enter the descriptions for Project, Subproject and Object as prompted.
4. Now select Settings à IDoc Inbound Processing
5. IDoc Inbound Processing screen appears. Enter the required details as shown below:
6. Click on Activate IDoc Inbound Processing.
7. Click on Yes when prompted for Activate IDoc Inbound?
8. Hit on Back to return to the main screen.
9. Click on Continue (F8). Following Screen appears:
10. Select the Step 1 Maintain Object Attributes and select Execute.
11. Select the radio button Business Object Method and enter the following details:
Business Object: BUS2012
Method: CreateFromData
Hit ENTER
12. Save and click on BACK button. Following information message is displayed.
13. Now select step 2 Maintain Source Structures and click Execute.
14. In this step, we need to maintain the source structure. In our example, lets consider the example of a file with 2 structures Head and Item data as shown below:
Click on Create and name the source structure as HEADERDATA. Now select HEADERDATA and click on Create again to create the child structure. Following popup appears:
Select Lower Level and click on Continue. Enter the Item data structure name.
Click Save and hit BACK button to go to the main screen.
15. Select step 3 Maintain Source Fields and hit execute.
16. Enter the fields as shown below:
17. Click SAVE and return to main screen.
18. Select step 4 Maintain Structure Relations and click Execute.
Select E1PORDCR and click on CREATE RelationShip. Following screen appears:
Select HEADERDATA and hit ENTER
Similarly do the same for the structure E1BPEKKOA, E1BPEKPOC and E1BPPEKET.
Click Save and return to main screen.
19. Select the step Maintain Field Mapping and Conversion Rules and click on execute. Maintain the Field Mapping as seen below:
20. Select step 7 Maintain Source Files and provide the link for the test file created. (Create a test file with the same structure as defined earlier).
Save and return to main screen.
21. Select the step Assign Files and click on Execute.
Assign the file provided to the source structure. Here the same file is provided for both the structures.
Save and return to the main screen.
22. Select the step Read Data and click on Execute.
Click on Execute.
Return to the main screen.
23. Select the step Display read data and click on execute.
Click on the structure name to get the field level values.
24. Return to main screen and now select Convert Data.
25. Return to the main screen and select Display Converted data.
26. Return to main screen and select Start IDoc generation.
27. Now select the step Start IDoc Processing on the main screen.
28. Return to main screen and click on Create IDoc overview. Here the data record and status records of the IDoc could be viewed:
Please Go through these Links ,
BAPI with LSMW
http://esnips.com/doc/ef04c89f-f3a2-473c-beee-6db5bb3dbb0e/LSMW-with-BAPI
For document on using BAPI with LSMW, I suggest you to visit:
http://www.****************/Tutorials/LSMW/BAPIinLSMW/BL1.htm
http://myweb.dal.ca/hchinni/sap/lsmw_home.htm
http://sapabap.iespana.es/sapabap/manuales/pdf/lsmw.pdf
Regards -
Unable to tarnsfer Activity related settings to Mobile client
Hi all,
We are developing a mobile sales application for CRM using xapps MSAHH 5.0. We are using SAP MI 2.5 SP 20 and DB2E 8.2.4 . We have configured the backend for activity related data, but when try to run the application on client it is giving a error on jsp which is as follows.:
"Download activities-related data and try again"
When we are checking the trace file in client it is showing the following error:
"ERROR_PROCESSTYPE - activity - com.sap.crm.handheld.component.activity.control.impl.ActivityCreateImpl - onLoad"
This is a generic sync application. and we are trying to see wether the initial data download that populates the dropdowns on the jsp is taking place or not.
Also is the Business partner related data necessary for the activity related settings to take place.
Can anyone help on this.
Thanks & Regards,
SumitHi,
well, this is difficult to say without seeing the code....
The question is: what data is missing and the bigger question: why is data missing?????
Have you checked the setup on the backend, Sync Monitor? Anything still in O-Waiting for the device? If one object is waiting there - mostly that is okay. If more then one objects are waiting per BO, then usually you have to sync until it is down to 1. Even this means you have to sync 250 times.
A good thing to get a better solution if this is the problem: switch on Repetitive Sync and set the reqDirectSync=true in the MEREPMETA.XML file.
Does this help? As I said - without code I have to guess a little. If you interested you could send me an installed imaged with data and the source, then I can debug and tell you more.
Regard,s
Oliver
Maybe you are looking for
-
We are trying to sever our portal on the iPad. I have pdf, doc, ppt and xls files with hyperlinks in them. I can open the files in Safari and Terra but the links don't work. I have spoken to Apple support and they said there must be a permissions
-
How to use commit and rollback transaction if my i am using MS Access as a
as per my knowledge the transactions commit and rollback is not work if my data base is MS Access then plz give me the logic how i used these transaction with MS Access. waiting for response plz mail ur respose if possible at [email protected]
-
Problem in RSPO_RETURN_ABAP_SPOOLJOB_RAW
Hi Friends, I have a problem. I am running reports which has output line more than 255 characters. Firstly I have tried to use RSPO_RETURN_ABAP_SPOOLJOB fm. But I see that I can not get the characters that has index more than 255. So, I wanted to use
-
How to improve quality of screen snaps
We are converting our graphics from EPS to SVG using CS3/4. We have noticed when we print our resulting graphics (using the SVG rendition) that line art illustrations appear clearer. However, our screen snap pictures have lost some clarity. Have I mi
-
FormMail Contact Form Coding Issue
Hi folks - this maybe quite a lengthly issue - however i think it is a simple mistake somewhere Basically I am having problem getting my submit contact form to work. I used the FormMail.pl script. www.kme-steelworks.co.uk is the website I am trying t