BAPI to create Purchse View for Article
Hi,
I have created article using MM41 and maintained BASIC DATA and ADDITIONAL BASICDATA for it. I have to now maintain PURCHASE VIEW for that article.
I am using FM WRF_MATERIAL_MAINTAINDATA_RT to create purchase view.
I am passing data to two structure INFORECORD_GENERAL STRUCTURE BAPIEINA
INFORECORD_PURCHORG STRUCTURE WRFBAPIEINE
that holds purchase view data.
BAPI returns telling article is changed. but if i go check in MM43 it is not changed.
BAPI works fine if i try to modify any data except for the above.
Can any one suggest me how to tackle this or is there any other way to create new purchse view for existing article.
Vanitha P
>
Vanitha P wrote:
> Hi,
>
> I have created article using MM41 and maintained BASIC DATA and ADDITIONAL BASICDATA for it. I have to now maintain PURCHASE VIEW for that article.
>
> I am using FM WRF_MATERIAL_MAINTAINDATA_RT to create purchase view.
>
> I am passing data to two structure INFORECORD_GENERAL STRUCTURE BAPIEINA
> INFORECORD_PURCHORG STRUCTURE WRFBAPIEINE
> that holds purchase view data.
>
> BAPI returns telling article is changed. but if i go check in MM43 it is not changed.
>
>
> BAPI works fine if i try to modify any data except for the above.
>
> Can any one suggest me how to tackle this or is there any other way to create new purchse view for existing article.
>
>
>
> Vanitha P
Here a simple example code for upload Material data:
*& Form call_bapi
* text
FORM call_bapi USING is_head TYPE bapimathead
is_mara TYPE bapi_mara
is_marax TYPE bapi_marax
is_marc TYPE bapi_marc
is_marcx TYPE bapi_marcx
is_mbew TYPE bapi_mbew
is_mbewx TYPE bapi_mbewx
is_mvke TYPE bapi_mvke
is_mvkex TYPE bapi_mvkex
is_mlan type bapi_mlan.
Data: lt_mlan type table of bapi_mlan.
Append is_mlan to lt_mlan.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = ls_head
clientdata = ls_mara
clientdatax = ls_marax
plantdata = ls_marc
plantdatax = ls_marcx
* FORECASTPARAMETERS =
* FORECASTPARAMETERSX =
* PLANNINGDATA =
* PLANNINGDATAX =
* STORAGELOCATIONDATA =
* STORAGELOCATIONDATAX =
valuationdata = ls_mbew
valuationdatax = ls_mbewx
* WAREHOUSENUMBERDATA =
* WAREHOUSENUMBERDATAX =
salesdata = is_mvke
salesdatax = is_mvkex
* STORAGETYPEDATA =
* STORAGETYPEDATAX =
* FLAG_ONLINE = ' '
* FLAG_CAD_CALL = ' '
* NO_DEQUEUE = ' '
* NO_ROLLBACK_WORK = ' '
IMPORTING
return = gs_return
TABLES
materialdescription = gt_makt
* unitsofmeasure = gt_uom
* unitsofmeasurex = gt_uomx
internationalartnos = gt_mean
* MATERIALLONGTEXT =
TAXCLASSIFICATIONS = lt_mlan
* RETURNMESSAGES =
* PRTDATA =
* PRTDATAX =
* EXTENSIONIN =
* EXTENSIONINX =
* READ TABLE gt_return INTO gs_return WITH KEY type = gc_return_s.
* IF sy-subrc = 0.
IF gs_return-type EQ gc_return_s.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
* IMPORTING
* RETURN =
ELSE.
WRITE: /.
WRITE: ls_mara-old_mat_no, gs_return-type,
' ', gs_return-message(50).
ENDIF.
CLEAR gs_return.
ENDFORM. "call_bapi
Similar Messages
-
[ADF Help] How to create a view for multiple tables
Hi,
I am using Jdeveloper 11G and ADF framework, and trying to create a view to update multiple tables.
ex:
Table A has these fields: ID, Name
Table B has these fields: ID, Address
A.ID and B.ID are primary keys.
B.ID has FK relationship with A.ID
(basically, these tables have one-to-one relation)
I want to create a view object, which contains these fields: B.ID (or A.ID), A.Name, B.Address.
So I can execute C,R,U,D for both tables.
I create these tables in DB, and create entity objects for these tables.
So there are 2 entity objects and 1 association.
Then I create a view object based on B and add fields of A into the view:
If the association is not a "Composition Association",
when I run the model ("Oracle Business Component Browser") and try to insert new data, fields of A can't edit.
If the association is a "Composition Association", and click the insert button, I will get
"oracle.jbo.InvalidOwnerException: JBO-25030: Failed to find or invalidate owning entity"
If I create a view object based on A and add filed of B into the view:
When I run the model and try to insert new data, fields of B can't edit, no matter the association is or is not a composition association.
So... how can I create a view for multiple tables correctly?
Thanks for any advices!
Here are some pictures about my problem, if there is any unclear point, please let me know.
http://leonjava.blogspot.com/2009_10_01_archive.html
(A is Prod, B is CpuSocket)
Edited by: user8093176 on Oct 25, 2009 12:29 AMHi Branislav,
Thanks, but the result is same ....
In the step 2 of creating view object, I can select entity objects to be added in to the view.
If I select A first, and then select B (the "Source Usage" of B is A), then finishing the wizards.
When I try to create a new record in the view, I can't edit any properties of B (those files are disabled).
If I select B first, and then select A in crating view object, the result is similar ...
Thanks for any further suggestion.
Leon -
Do I need to create a view for this?
Hi Ihave got 2 tables emp and project
In emp tabe:
emp_no
family name
given name
In porgect table:
emp_no
status(assigned,unassigned)
start_date
end_date
emp_no Family_name given_name
1 Smith John
In project table same employee can have many assigement eg
emp_no status start_date end_date
1 assigned 01-may-08 01-july-08
1 assigned 01-sep-08 01-july-09
1 unassigned 01-july-09 01-oct-09
In the form:
there are 2 querable fields "project ends between field1(date) and field2(date)" which is used to
retrive records which have end date between field1 and field2.
The following fields are needed to get from database:
emp.family_name emp.given_name project.start_date project.end_date No.of time assigned
Requirements:
1. project.start_date and project.end_date must be the latest project_end_date for the same emp
so in the above sample date
2. No. of time assigned is a count of total of number records which have status='assign'
So for the given sample data the record expected after query would be(field1=01-jun-08 field2=02-july-09)
emp.family_name emp.given_name project.start_date project.end_date No.of time assigned
Smith John 01-sep-08 01-july-09 2
What is the best approach to get:
1 The lastest project(latest end_date) for the emp
2. get No.of time assigned.
Do I need to create a view for this? If yes, any sample sql code this this?
Thanks for your helpHi W1zard,
Thanks for your reply. Could you clarify the following points for me:
1.) you could create a master block basing on your emp table and a detail block basing on your project table with the relation over emp_no. set the default_where clause of your detail block programmatically using
set_block_property('project', default_where, 'status = ''assigned'' and <your_date_criteria>');
Q1: where I pit this code? in pre-query trigger in detail block?
2.) Of course you could create a view to join both of your tables if you don't want to use master detail blocks; Also do the join over emp_no
create or replace force view v_emp as
select emp.family_name, emp.given_name, project.start_date, project.end_date
from emp, project
where emp.emp_no = project.emp_no
Q2 As I mentioned before, there are multipal entries for the same emp in project table and we only need the maching record from project table which has latest end_date. So I think I need something like
max(project.end_date) somewhere in create view to make sure only one record for one employee.
Also is there possible to include the no. of assigned field(select count(*) from project where status='assigned' and emp=emp_no) into the view as well?
Q3 All the fields mentioned above are diaplay-only. So Can I create a control block which has all the fields from emp and project. Then populate them with my sql. The question is
where I put this customerised sql so when user click excute query. My sql will run and display one the form?
REally appreciated your help!
Michael -
Creating Classification view for material through Standard Function
hi,
I have created the material code through BAPI_MATERIAL_SAVEDATA. For quality inspection i have used BAPI_MATINSPCTRL_SAVEREPLICA. i have to create classification view for that material code. Can anyone suggest me which standard function helps me to create the classification view.
Thanks in advance.
Senjeyhi,
i have tried that function module. I have mentioned the code below.
i_object = '000000151860630000'.
i_alloc_num-CHARACT = 'THICKNESS'.
i_alloc_num-VALUE_FROM = '5.70'.
append i_alloc_num.
i_alloc_char-charact = 'SHAPES'.
i_alloc_char-VALUE_CHAR = 'PLATE'.
append i_alloc_char.
clear i_alloc_char.
i_alloc_char-charact = 'CATEGORY'.
i_alloc_char-VALUE_CHAR = 'CS'.
append i_alloc_char.
clear i_alloc_char.
CALL FUNCTION 'BAPI_OBJCL_CREATE'
EXPORTING
OBJECTKEYNEW = i_object
OBJECTTABLENEW = 'MARA'
CLASSNUMNEW = 'RAWMATERIAL'
CLASSTYPENEW = '001'
STATUS = '1'
STANDARDCLASS =
CHANGENUMBER =
KEYDATE = SY-DATUM
NO_DEFAULT_VALUES = ' '
IMPORTING
CLASSIF_STATUS =
TABLES
ALLOCVALUESNUM = i_alloc_num
ALLOCVALUESCHAR = i_alloc_char
RETURN = i_ret.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
But i am getting the error 'Assignment exists and is valid '.
Please help.
Regards,
Sengathir.J -
How to create classification view for material?
HI All,
How to create classification view for material? is there any function module?
pls let me know.
Bandicheck the standard include "LCLBPAU14" this is using the following F.M
call function 'BAPI_OBJCL_CREATE'
exporting
objectkeynew = l_object
objecttablenew = l_objecttable
classnumnew = classnum_new
classtypenew = l_classtype
status = status
standardclass = standardclass
changenumber = changenumber
keydate = keydate
no_default_values = no_default_values
importing
classif_status = classif_status
tables
allocvaluesnum = allocvaluesnum
allocvalueschar = allocvalueschar
allocvaluescurr = allocvaluescurr
return = return. -
How to create thumbnail view for html files
hi,
I want to create thumbnail view for html files, not for image files.. can we treat html files as images..
Anybody help me..You can right click on your Desktop and select New Folder. In Finder File > New Folder should work too, not in front of my Mac.
Welcome to back by the way. You might find these websites helpful.
Switch 101
Mac 101 -
FM or BAPI to create 1001 IT for Central Person
Hi Friends
I need FM or BAPI to create 1001 relationship for OTYPE CP ' Central Person ' .
FM HR_CENTRALPERSON_INSERT is there to create IT 1000 for CP i need for 1001 IT
anybody pls guide me.
Regards
MeetaHi
Thanks for your response
i have to create CP for B209 relations type ( subtype )
but prog giving me error ( Relationship CP B 209 P cannot be maintained using basic trainsaciton )
CALL FUNCTION 'RH_RELATION_MAINTAIN'
EXPORTING
ACT_FCODE = 'INSE'
ACT_PLVAR = '01'
ACT_OTYPE = 'CP'
ACT_OBJID = '01119840'
ACT_ISTAT = '1'
ACT_RSIGN = 'B'
ACT_RELAT = '209'
ACT_SCLAS = 'P'
ACT_SOBID = '01119840'
ACT_BEGDA = SY-DATUM
ACT_ENDDA = '99991231'
ACT_PRIOX =
ACT_PROZT =
REL_ENDDA =
EXCEPTIONS
MAINTAINANCE_FAILED = 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.
Regards
Meeta -
Creating relational view for an ODBC result set?
Hello,
I'm trying to create a view for the data available from the Siebel Analytics server (SAS) query's result set by executing pass through sql. SAS reads from files and multiple other databases to provide the result set.
The query sent to pass has its own properitary syntax and is not SQL.
ie, I'm trying to achieve something like this :
create view analytics_wrapper_view as
select * from
<
dbms_hs_passthrough('my custom sql understood by SAS')
dbms_hs_passthrough.fetch_rows
>
Cant use a function selecting from dual as there could be several rows returned from this operation. If I retain it as a view, I can avoid data duplication. If this is not possible, a table approach could be considered.
Any thoughts or inputs on this would be highly appreciated.On your server..
- On the FCS server go to OSX Workgroup Manager.
- Create a group and name it something cool
- save and exit
Final Cut Server Client...
(Logged in as admin)
- select Administration in the client.
- Go to Group Permissions
- click Create New Group and then select cool new group name
and select BROWSER from the PERMISSION SET list
- save and go back to OSX
Back in OSX Workgroup Manager...
- create users and assign them to your cool group
DONE! -
Which BAPI can Create handling Unit for VL02N.
Dear All,
Which BAPI can Create handling Unit for VL02N.
The Business is: VL02N, click head toolbar PACK, then call up handling Unit.
ThanksHi sun!
I'm facing the same requirement since three days and i'm not able to get it workin.
Did you resolve the problem and if yes which function modules did you use?
Thanks in advance!
Florian
Edited by: Florian Visintin on Sep 17, 2009 10:21 AM
Edited by: Florian Visintin on Sep 17, 2009 10:22 AM -
Creating 'Z' views for Standard ABAP Web dynpro Application
Hi Experts,
I am totaly new to ABAP web dynpro objects.
In our project there were some client requirements which required us to change the properties of the Views related to the Webdynpro. The Client now has said that he needs to apply some enhancement pathces on his system. Due to this, the changes made to the Views i.e all the changes done in standard code are lost.
The client now wants a long term solution where all the changes need to be done in 'Z' implimentataion so that changes are not lost every time the pathces are applied.
Is it possible to create an entire new 'Z' Views for the standard Webdynpro instead of standrad ones?
If Yes how does one link them to the Webdynpro application ?Hi
Have a look at following article about enhancing webdynpro applications.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/700317da-bd79-2c10-368e-8f18bf5d8b81?quicklink=index&overridelayout=true
Regards
Manas Dua -
Creating a view for a datasource with KONP
Hi.
I have the many times discussed problem with the reference field in datasources are not possible. Most provided solution was to create a view on KONP and e.g. RV13A. But if I want do this I run into an error: Table RV13A is not transparent
Could someone give me a hind how to solve this? I found no article about that.
Thanks in advance,
NilsHi.
I ever done that with FM, but a view would be much easier sometime.
Thanks for your replies, perhaps I will try to use an InfoSet, but to do it by FM would not be much complicated.
THX Nils -
How to create a view for all Service Requests that are not approved by reviewer
Hallo,
I want to create a view in the Service Requests library that shows all SRs that are not approved. How to configure condition that says: if a SR has related Review Activity which is In Progress, show that SRs?
I couldn't find this when creating the view. Thank you.So here's the first problem with that: Which review activity? a SR can contain multiple RAs, so how do we decide if an arbitrary SR is approved or not?
As to the specific language you use (Any child RA is In Progress) you might want to look at the criteria from the default Change approval view, which does something similar:
<QueryCriteria Adapter="omsdk://Adapters/Criteria" xmlns="http://tempuri.org/Criteria.xsd">
<Criteria>
<FreeformCriteria>
<Freeform>
<Criteria xmlns="http://Microsoft.EnterpriseManagement.Core.Criteria/">
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpressionLeft>
<Property>$Context/Path[Relationship='CoreActivity!System.WorkItemContainsActivity' TypeConstraint='CoreActivity!System.WorkItem.Activity.ReviewActivity']/Property[Type='CoreActivity!System.WorkItem.Activity']/Status$</Property>
</ValueExpressionLeft>
<Operator>Equal</Operator>
<ValueExpressionRight>
<Value>$MPElement[Name="CoreActivity!ActivityStatusEnum.Active"]$</Value>
</ValueExpressionRight>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpressionLeft>
<Property>$Context/Property[Type='CoreChange!System.WorkItem.ChangeRequest']/Status$</Property>
</ValueExpressionLeft>
<Operator>Equal</Operator>
<ValueExpressionRight>
<Value>$MPElement[Name="CoreChange!ChangeStatusEnum.InProgress"]$</Value>
</ValueExpressionRight>
</SimpleExpression>
</Expression>
</And>
</Expression>
</Criteria>
</Freeform>
</FreeformCriteria>
</Criteria>
</QueryCriteria>
This is a simple AND criteria with two componets. one looking for a Review Activity (TypeConstraint='CoreActivity!System.WorkItem.Activity.ReviewActivity') which is related to the targetting CR by Contains Activity ($Context/Path[Relationship='CoreActivity!System.WorkItemContainsActivity';
Context in this... context means the CR targeted by the view) where it's status (/Property[Type='CoreActivity!System.WorkItem.Activity']/Status$) is In Progress ($MPElement[Name="CoreActivity!ActivityStatusEnum.Active"]$). The other is filtering
for the target change request's status ( $Context/Property[Type='CoreChange!System.WorkItem.ChangeRequest']/Status$) is In Progress ($MPElement[Name="CoreChange!ChangeStatusEnum.InProgress"]$).
You could convert the second criteria to point to SRs and SR status values, and then use the similar text for the first criteria. i'd recommend
Anton's Advanced View Editor (or
the free version) to do the criteria adjustment. -
Need to create maintenance view for a custom infotype
A custom infotype 90XX is created. The data cannot be modified or created through PA30 in this infotype. Through PA 40 actions only we can create/change the record/data. We have created some 1000 records in it. Now can we create a maintenance view for the infotype so that we can create, delete or change the data in the infotype as and when we want.
Hi,
pls chk dat u have maintained the 'Infotype Charecteristics' and 'Technical Attributes' correctly.
thanks,
teja. -
Creating a view for a datasource
Hi experts,
I'm kinda new in BW and ABAP, but I have a requirement to get a datasource that contains data between SAP Tables. The scenario should be like this :
1. Get all Personal Number from PA9038 (Customized Infotype) within a period ( ENDDA & BEGDA as the parameters )
2. Get only the last Cost Center each person has from PA0001-KOSTL
3. Get only the last Assessment Value from PA9040 (Customized Infotype)
Is there any way to create a view based on that scenario? I've tried using the create view via SE11 and I was confused about joining the tables to get only the last data from PA0001 and PA9040.
Or is there any method to build a Fact Table that contains the data I need?
PS:
Actually if I used ABAP Commands, I can generate this data in Internal tables and joining them into one internal tables.
Probably the ABAP Codes are like this :
SELECT pernr endda begda
FROM pa9038
INTO CORRESPONDING FIELDS OF TABLE itab1.
IF NOT itab1[] is initial.
SELECT pernr endda begda kostl
FROM pa0001
FOR ALL ENTRIES IN itab1
INTO CORRESPONDING FIELDS OF TABLE itab2.
*For getting the last record I can manipulate the data in itab2 like this
SORT itab2 BY pernr ASCENDING endda DESCENDING begda DESCENDING.
DELETE ADJACENT DUPLICATES FROM itab2 COMPARING pernr.
ENDIF.
LOOP AT itab1.
READ TABLE itab2.
...... and so on.
ENDLOOP.
Thanks for the help...Hi Febrain,
Identify the base tables from where you can fetch the data from. Then Using those tables you create a VIEW. Using the view you create a generic Datasouce.
Please use this url for more info..
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/3f/548c9ec754ee4d90188a4f108e0121/content.htm
Regards -
Reg: Join Conditions for Tables to create a View for Generic Extraction
Hi Experts,
Am trying to extract the data from Solman, for this purpose am creating a Generic Extractor based on three tables. So, can anyone please help me out by providing the join conditions to create a view based upon the following three tables,
1. CRM_ORDERM_H
2. DNOD_NOTIF
3. DNOD_NOTIF_S
Anyways i require the following fields in the extractor finally:
CRM CHANGED AT
GUID
SAP COMPONENT
RELEASE
REPORTED BY
These are the some of the major fields that i require in the final extractior. Please help me out ASAP with the table join conditions..
Will Assign Points for the helpfull answer...
Thanks,
Gattu.Hi,
I don't know the table CRM_ORDERM_H however you can link DNOD_NOTIF and DNOD_NOTIF_S
DNOD_NOTIF_S-CLIENT = DNOD_NOTIF-CLIENT
DNOD_NOTIF_S-GUIDS = DNOD_NOTIF-GUIDS
For the third table could you please paste here its definition like the hereunder?
Transp. table DNOD_NOTIF Active
Short Text Notification Header
Field KeyInitData element Data TyLengthDecimaShort Text
CLIENT X X MANDT CLNT 3 0Client
GUIDH X X DNOT_GUIDH RAW 16 0GUID Notification
.INCLUDE DNOS_NOTIF_INT STRU 0 0Notifications (Header, Internal Fields)
OBJNR DNOT_OBJNR CHAR 22 0Status Management Object Number
STATUS DNOT_STATUS CHAR 1 0Notification Status
DELETED DNOT_DELE_N CHAR 1 0Deletion Indicator Notification
PROCESSOR DNOT_PROC CHAR 12 0Current Processor
TYPE_PROC DNOT_TYPE_PRC CHAR 2 0Type of Processor
REPORTER DNOT_REPORTER CHAR 12 0Reported By
TYPE_REPO DNOT_TYPE_REP CHAR 2 0Type of Notification Creator
CREA_TSTMP DNOT_CREA_TSTMP DEC 15 0Entry Time Stamp
CHNG_TSTMP DNOT_CHNG_TSTMP DEC 15 0Time of Last Change
START_TSTMP DNOT_START_TSTMPDEC 15 0Initial Response Time - Time Stamp
END_TSTMP DNOT_END_TSTMP DEC 15 0Requested End of Processing - Time Stamp
CLO_TSTMP DNOT_CLO_TSTMP DEC 15 0Completion Time Stamp
.INCLUDE DNOS_NOTIF_EXT STRU 0 0Notifications (Header, External Fields)
NUMB DNOT_NUM CHAR 12 0Notification Number (External)
REFNUM DNOT_REFNUM CHAR 20 0External Reference Number
TYPE_NOTIF DNOT_TYPE_N CHAR 6 0Message category
CATEGORY DNOT_CATEGORY CHAR 12 0Topic, Area
SUBJECT DNOT_SUBJECT CHAR 60 0Re:
PRIORITY DNOT_PRIORITY CHAR 1 0Notification priority
LANGUAGE DNOT_LANG_N LANG 1 0Notification Language
hope this helps...
Olivier.
Maybe you are looking for
-
Loss of internet connection from windows side of imac duo core
I have cable modem as internet hookup. When I am in Mac I have no problems, but every time I either change to the Windows side, or the computer is turned off or goes off, when Windows comes up, I can't access the internet. I have gone into control pa
-
Added new field in SC Item table but after Check/Enter the value disappears
I have added a field in the SC Item table in view V_SC_DOTC_BASIC. Everything works perfectly well except that when a value is entered into that field and ENTER or CHECK is selected, the value goes away and the field becomes a read-only field with no
-
Return proesss through sales order qty
Hi all My client has requirement in return it could process through reference to sales order but but problem is system capture only sales order quantity not more than that sales order quantity how to configure this in sap thanks and regards rajesh
-
Interactive Report issue ( hw to come 5th list to back 2nd list directly )
Hi Experts, I have one issue regarding Interactive report. --> I am in 5th list , and i want go directly to the 2nd list . --> Hw we select multiple line of data in one list and pass to another list. Helpful answers will reward. Re
-
Hi All. I am facing problem while creting the record in infotype 586. System is giving an information error, that record for current FY already exist, where as there is record for the last FY. not the current FY. Please suggest. Regards, Aman