BAPI Usage
Hello Everyone,
I am new to Webdynpro ABAP. I have been looking in to the creation of Webdynpro Component using a BAPI. I have created an application which uses the BAPI (BAPI_PO_CREATE). But when I test the application after desigining the view and assiging the component to an application. The application is throwing the following error message in the browser. Could anyone please help in resolving this issue. I would appreciate your help.
The following error text was processed in the system DV1 : Adapter error in &VIEW_ELEMENT_TYPE& "G_L_ACCT_LBL" of view "ZPO_CREATE.V_MAIN": Context binding of property TEXT cannot be resolved: Node COMPONENTCONTROLLER.1.BAPI_PO_CREATE.1.CHANGING.1.PO_ITEM_ACCOUNT_ASSI does not contain any elements
The error occurred on the application server sapdv5_DV1_00 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: RAISE_FOR of program CX_WDR_ADAPTER_EXCEPTION======CP
Method: RAISE_BINDING_EXCEPTION of program CL_WDR_VIEW_ELEMENT_ADAPTER===CP
Method: GET_BOUND_ELEMENT of program CL_WDR_VIEW_ELEMENT_ADAPTER===CP
Regards,
Gopal.
Hello ,
i think you have problem at service call please follow the following way
1. when you go to service call wizard it will take to different steps like strat, select controller,select service, ......
2.now you might be doing some mistake at adapttive Context step
when you go to this step you will get
a. node type
b..node name
c.object type -
> here you have to select c(contextnode/Attribute).
3.then follow the way which your doing
i think it will solve your problem.
Thanks,
Shaik Shadulla.
Similar Messages
-
Web Dynpro for ABAP: Tutorial 2 - BAPI Usage
Hi ,
I am new in WD for ABAP and i trying to finish tutorials from SDN. The Second tutorial
"Web Dynpro for ABAP: Tutorial 2 -BAPI Usage" is giving me headache .I was following the tutorial in a letter ,
but the table is not filled d after I hit "search" button. Does someone had same experience and possible solution.
Thanks
ChrisActually in this application the data that is required is flowing. So I have tried making the import parameters as the controller attributes in spite of context node in the service call. Then it passes the data into the import parameters as WD_THIS->KUNNR.
But still when I am debugging the data is not coming. What could be the issue. -
Hi, I am very new to Wd abap,
Can anybody explain about the Tutorial-2, Bapi usage.
Thank's
Srihi sridevi....
whenever you need to access an sap or non sap system using rfc or bapi you will go for a service call. it automatically creates the rfc destination if needed. the service call process automatically writes the codings and creates atrributes and nodes automaically according to the bapi you have mentioned.
---regards,
alex b justin -
How to populate a custom field of a Std. SAP Tx with BAPI usage 2 Load data
Hi Experts,
For instance, I created a custom field (say, custom_field_1) on a screen of standard SAP tx(say, ME21N) by using screen exit. And in order to populate the data into it (custom_field_1), will use the Function user exits of this Tx(ME23N).
1) In next step, Where Where I have to add this field, apart from appending the same custom field in EKKO/EKPO table or any other related table; Extending the corresponding IDOC or creating a new Custom ÍDOC type? like What about BAPI?
2) If I got a text file with the data (including the data for this custom_field_1 too) and I have been asked to load it into SAP, then, I decided to use BAPI (say, BAPI_PO_CREATE or CREATE1) to create the data, So, How to handle this custom field, I mean, In which BAPI structure I have to pass this custom_field_1 data? ( Iguess, for some BAPIs EXTENSIONIN structures are provided, sorry if am wrong!)
Thank you.
Edited by: SAP ABAPer on Feb 21, 2009 7:40 PMfor example if you added field in the VBAP table then you can pass the custome field values like below
move 'BAPE_VBAP' to lwa_extension-structure.
lwa_bape_vbap-vbeln = lwa_final-vbeln.
lwa_bape_vbap-posnr = lv_posnr.
move lwa_final-yyslotid to lwa_bape_vbap-new custome field.
move lwa_bape_vbap to lwa_extension-valuepart1.
append lwa_extension to lt_extension.
clear lwa_extension.
move 'BAPE_VBAPX' to lwa_extension-structure.
lwa_bape_vbapx-vbeln = lwa_final-vbeln.
lwa_bape_vbapx-posnr = lv_posnr.
move 'X' to lwa_bape_vbapx--new custome field.
move lwa_bape_vbapx to lwa_extension-valuepart1.
append lwa_extension to lt_extension.
clear lwa_extension.
call function 'BAPI_SALESORDER_CHANGE'
exporting
salesdocument = strcture
order_header_inx = strcture
tables
order_item_in =strcture
order_item_inx = strcture
schedule_lines = strcture
schedule_linesx = strcture
extensionin = lt_extension. -
Error in BAPI call using webdynpro
hi ,
am new to this webdynpro abap..so i was trying out sample tutorials from sdn..when i trigger a button click event in order to call bapi function..the error has be raisen..so give me a solution for this..kindly chk out this link..i was trying for this application..i did exactly as mentioned in this tutorial..
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/00545e6d-0679-2910-acab-8073ce9a1659?rid=/webcontent/uuid/fed073e5-0901-0010-4eb4-c9882aac7b11 [original link is broken]
in this second tutorial..bapi usage
error :
The following error text was processed in the system NSP : RFC Exception COMMUNICATION_FAILURE with Message RFC destination bapi Fm does not exist. Occurred
The error occurred on the application server w2gzmbks01_NSP_00 and in the work process 0 .
The termination type was: RABAX_STATEHi Anuj,
I ve a similar kind of issue at my end. I am trying to call BAPI_DOCUMENT_CREATE2 from a Webdynpro application(A2C/000) and using commit work. A new doc_number is very much created, even commit work returns no error.
But surprisingly i dont see this new record in the same destination (A2C/000).
this BAPI is already remote enabled (SE37) -
Tutorial 2 for BAPI WDA - set column settings in Wizard - page 7, step 4.
To the Pretty Good WDA Programmers, and/or Experts,
I am new at this, so any help is appreciated.
In the tutorial: Dynpro for ABAP: Tutorial 2 - BAPI Usage at: https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/9cb5d345-0801-0010-6a8e-fc57c23fd600 has in page 7, step 4. Seems a little vague to me:
The Required Methods and Context Elements
On the two subsequent dialog windows, default values are listed for giving names to the context nodes and attributes required by the service call as well as to the required methods. The proposed names are based on the names of the embedded service, but you can change them as required.
So the question is, in the wizard for page 7, step 4, what are the column settings set to: Parameter Values / Controller Attribute / Context Node ... to get the BAPI Input/Output and Changing columns looking like they do in the tutorial on the next page (pg 8)?
Step-by-step, or in this case, column-by-column directions would be most helpful!
Thank You...
Edited by: Daniel Perecky on May 4, 2009 10:58 PMTo Trikanth and Saurav,
Thank you for those screen-shots Trikanth. They definitely helped point me in the right direction. The problem was that all of the 'Changing' structure sub-structures would end up in the view node.
When I would try to map 'Changing | Flight_List' with the context, a message would appear: 'Mapping is only possible for Flight_List if Parent is Mapped'. Then when I mapped the entire 'Changing' node, it would map to the Component Controller, but then it would not map correctly to the output display table.
Apparently only one dimension of structures could be mapped. A (deep) structure of structures cannot be.
So in step 4, in the wizard, to make this work, I had to only make visible 'Changing' by what you both kindly confirmed: making it Context.
Settings Summary: Root Node- unchangable.
Parameter Group 'Importing'- Context (Node/Attribute)- Unchangeable
Parameters- Airline - Changed to Context (Node/Attribute)
Dest_From - Changed to Context (Node/Attribute)
Dest_To - Changed to Context (Node/Attribute)
Max_Rows - Changed to Context (Node/Attribute)
Parameter Group 'Changing'- Context (Node/Attribute)- Unchangeable
Date_Range - left as Controller Attribute
Extension_In - left as Controller Attribute
Flight_List - Changed to Context (Node/Attribute) <---
Extension_Out - left as Controller Attribute
Return - left as Controller Attribute
So, when 'Changing' and ONLY 'Flight_List' was made visible in the node, it mapped correctly to both the Context node and to the output table columns.
This is great. Thanks a Lot! -
How to use BAPI TO change Data on EKPO from ALV
hi all,
i am a bignner i have alv grid dispaly forpurchasing document item (EKPO) after editing my ALV i want use a BAPI to update the details on EKPO table,
is it possible? if so please let me know how it can be done??hi davel,
thank you for quick replay i am beginner to ABAP
i am just practicing to study BAPI ...this requrement iwas taken by myself for studing BAPI usage..if its possible please let me know how can it be done??
thank u.. -
Is it okay to translate some existing weblog or the other article in korean
Dear SDN
i'm a korean.
There are so many great weblog & article in SDN.
is it okay to translate them into korean ?
if i do translate them and write weblog, can i get some points? ^^
and whenever i do it , do i need to ask the author's permission ?
<b>As you know, [Localized Content] does only work on each menu, not the real contents.
I think SAP developers need their own language contents.</b>
That's why i try to do this.
is it possible or not ?
Merry Christmas~ & Happy new yearDear Shay & Craig
I understand what you guys said.
so i plan to translate
https://www.sdn.sap.com/irj/sdn?rid=/library/uuid/02e1fa45-0801-0010-10a0-f1cf47e8c943
License Key Guide (PDF 148 KB)
Installation Guide (PDF 1.0 MB)
Web Dynpro for ABAP - Create a Simple Web Dynpro Application (PDF 1.5 MB)
Web Dynpro for ABAP - BAPI Usage (PDF 456 KB)
Web Dynpro for ABAP - BAPI Navigation (PDF 391 KB)
Web Dynpro for ABAP - Display Bookings for Selected Flights (PDF 342 KB)
Is it possible?
Will you provide the standard format of Document ( doc or pdf format)?
Will you support the screenshots of these documents?
Actually, i succeeded to install it and tested them by myself on my PC-korean win2k & XP. It means i can put my screenshots on the translated documents.
thanks -
Mass role & authorization creation
Hi all,
I have been assigned a task to create some 400+ authorizations. Using PFCG and creating one by one would take much time, so I wonder if there is a different approach.
Every role has a different number of transactions, but most of them have the same values for authorization objects (company code, purchasing group etc).
Anyone have an idea on how to do this?
Thank you,
IgorWhat about ECATT or even BAPI usage? There are ECATT procedures for mass users creation. Can that be used for roles as well?
Not as far as I know.
In any case, I will never relay in mass creation of roles as this will represent a security issue, and In my personal opinion is why SAP does not offer mass creation of roles as a standard
Regards
Juan -
Attaching function module to the webDynpro
Hi,
I am attaching the function module where i am using the "Web Dynpro for ABAP: Tutorial 2 - BAPI Usage". Now the problem is that in the document they have created the container form for the input parameters and in the context they have mapped the fields with the function module input parameters. But my requirement is little different. I have created the view which has dropdown boxes and I cant create a new container form. Now please suggest how should I map the Import parameters with the screen fields(dropdowns).
Please suggest some solution.
I hope you would have seen this document"Web Dynpro for ABAP: Tutorial 2 - BAPI Usage". if not I will send the link.Actually in this application the data that is required is flowing. So I have tried making the import parameters as the controller attributes in spite of context node in the service call. Then it passes the data into the import parameters as WD_THIS->KUNNR.
But still when I am debugging the data is not coming. What could be the issue. -
Dear All,
I am using BADI -AC_DOCUMENT
Can u please tell me how to add two more line item in the accounting document while creating MB1B Tranction code .
Regards
Kunwar Verma
MB-09204090623Hi Kunwar,
Try using control break statement for this purpose.I hope it will solve the issue you facing in BAPI,Usage of control break statement will let you enter the line itemes for repeated entry of the header item.
Have a best day ahead. -
Automatically calculate tax in bapi_incominginvoice_create
problem on bapi: bapi_incominginvoice_create
desciption:
we are using bapi: 'bapi_incominginvoice_create' to create InvoiceVerification automatically in our abap program,the parameters are below,we set the calc_tax_ind to 'X' in the IV header data,and the related po tax code is 'P0',Use these parameters we can create IV successfully but the IV has no tax data created. as for our requirements we need the IV with calc_tax_ind 'X' and with 'P0' tax data. can anybody help us to solve these problem, thanks for your kindly help.
bapi usage and our parameters below:
*part of our abap code
*header data
headerdata-INVOICE_IND = 'X'."invoice
headerdata-DOC_DATE = sy-datum. "doc date
headerdata-PSTNG_DATE = sy-datum. "Posting Date in the Document
headerdata-CURRENCY = 'USD'. "Currency Key
headerdata-GROSS_AMOUNT = 40.00. "Gross Invoice Amount in Document Currency
headerdata-COMP_CODE = '0001'. "Company Code
headerdata-CALC_TAX_IND = 'X'.
headerdata-HEADER_TXT = 'test'.
*item data
itemdata-INVOICE_DOC_ITEM = '00001'.
itemdata-PO_NUMBER = '4500007505'.
itemdata-PO_ITEM = '00010'
if po is GR-based IV
itemdata-REF_DOC = '50010095'
itemdata-REF_DOC_YEAR = '2006'
itemdata-REF_DOC_IT = '1'
endif.
itemdata-TAX_CODE = 'P0'
itemdata-ITEM_AMOUNT = 40.00
itemdata-QUANTITY = 4
itemdata-PO_UNIT = 'PC'
itemdata-PO_PR_UOM = 'PC'.
gross_amount = 40.00.
append itemdata.
CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'
EXPORTING
HEADERDATA = headerdata
ADDRESSDATA =
IMPORTING
INVOICEDOCNUMBER = invoicedocnumber
FISCALYEAR = fiscalyear
TABLES
ITEMDATA = itemdata
RETURN = returnits just a indicator , check ur Entry of IV , are u getting alll the G/L accounts or not ?
check ABAP generated IV with Manual IV ? is there any Diff in terms of Dr/Cr Entries ?
Regards
Prabhu -
'BAPI_ISUCONTRCT_CHANGEFROMDATA' what all paremetes i need to pass
Hi Experts,
In
'BAPI_ISUCONTRCT_CHANGEFROMDATA' what all paremetes i need to pass in import structure
contractdata =
contractdatax =
in contractdata i am passing vertrag what else i need to pass in this structure
, in contractdatax all parameters are size of characters 1
ThanksThat bapi doesn't have the instructions on the documentation - but look at another one to find out how to use bapis - or check with your technical team, as bapi usage is standard functionality.
regards,
bill. -
Hi Guys,
i'm looking for some tables including log-information of used rfc destinations. For now i have table EDIDC for IDoc-Logs. Do you know more tables, e.g. regarding BAPI usage? RFC logs in general (here i found ARFCSSTATE/ARFCRSTATE and some others, but they don't look as they would log all records, do they?
i just want to find out which rfc destinations are used and which not!
Best Regards
StefanHi Stefan,
Generally we will RFC logs from SM58.
(Or) Check tcode SLG1 for application Log.
Thanks,
Krishna. -
Example of correct BAPI_BUS1077_CREATE call
Hi!
Does anybody know how to create a hazard calling this bapi ? I've tried several combinations but it always returns me several errors, for example, not enough parameters, required fields not filled,...
If anybody could give me an example of its call (e.g. for the first level) i would appreciate it so much.
Thanks!!
Regards,
Diana.*& Report RC1_1077_BAPI_EXAMPLE_CHANGE
*& On the one hand, this Report is an automatic test for the BAPI- functions.
*& It performs different methods to create, edit and delete specifications and
*& shows on a list, if any errors occured by performing the BAPI-functions.
*& On the other hand, this report can be used as reference-code and tutorial for using
*& the BAPI-functions.
*& The here tested BAPI-functions are:
*& Function Short description
*& BAPI_BUS1077_CREATE Creates a new specification or a property of an existing one
*& BAPI_BUS1077_CHANGE Changes properties of an existing specification
*& BAPI_BUS1077_DELETE Deletes a specification or single properties
*& BAPI_TRANSACTION_COMMIT Commits the work
*& BAPI_BUS1077_SAVEFROMBUFFER Clears locks and saves data from buffer to dictionary
*& BAPI_BUS1077_GETDETAIL Reads properties of existing specifications
*& The following methods are relevant for you, if you need some information how to use
*& these functions(detailed information about methods in their definitions):
*& Method Short description Used BAPI- functions
*& class_setup Creates the two Test- specifications BAPI_BUS1077_CREATE; BAPI_TRANSACTION_COMMIT; BAPI_BUS1077_SAVEFROMBUFFER
*& class_teardown Deletes the two Test- specifications BAPI_BUS1077_DELETE; BAPI_TRANSACTION_COMMIT; BAPI_BUS1077_SAVEFROMBUFFER
*& test_change_subheader Changes data in the substance-header BAPI_BUS1077_GETDETAIL; BAPI_BUS1077_CHANGE; BAPI_TRANSACTION_COMMIT; BAPI_BUS1077_SAVEFROMBUFFER
*& test_change_comp Changes the first component in the property BAPI_BUS1077_GETDETAIL; BAPI_BUS1077_CHANGE; BAPI_TRANSACTION_COMMIT; BAPI_BUS1077_SAVEFROMBUFFER
*& test_change_ident Changes the first identifier of a specification BAPI_BUS1077_GETDETAIL; BAPI_BUS1077_CHANGE; BAPI_TRANSACTION_COMMIT; BAPI_BUS1077_SAVEFROMBUFFER
*& test_change_ident_usage Changes the identifier usage of a specification BAPI_BUS1077_GETDETAIL; BAPI_BUS1077_CHANGE; BAPI_TRANSACTION_COMMIT; BAPI_BUS1077_SAVEFROMBUFFER
*& test_change_prop_ftext Changes the property ftext & longtext of a specification BAPI_BUS1077_GETDETAIL; BAPI_BUS1077_CHANGE; BAPI_TRANSACTION_COMMIT; BAPI_BUS1077_SAVEFROMBUFFER
*& test_change_prop_usage Changes the first property usage of a specification BAPI_BUS1077_GETDETAIL; BAPI_BUS1077_CHANGE; BAPI_TRANSACTION_COMMIT; BAPI_BUS1077_SAVEFROMBUFFER
*& test_change_ident_longtext Changes the identifier longtext of a specification BAPI_BUS1077_GETDETAIL; BAPI_BUS1077_CHANGE; BAPI_TRANSACTION_COMMIT; BAPI_BUS1077_SAVEFROMBUFFER
*& test_read_usage_filter Assures that the usage filter is working properly BAPI_BUS1077_GETDETAIL
*& test_ref_subs Assure that specification referencescan be created BAPI_BUS1077_GETDETAIL; BAPI_BUS1077_CREATE; BAPI_TRANSACTION_COMMIT; BAPI_BUS1077_SAVEFROMBUFFER
*& test_change_comp Changes the first component in a property BAPI_BUS1077_GETDETAIL; BAPI_BUS1077_CHANGE; BAPI_TRANSACTION_COMMIT; BAPI_BUS1077_SAVEFROMBUFFER
*& test_change_assessment Changes the assessment of a value assignment BAPI_BUS1077_GETDETAIL; BAPI_BUS1077_CHANGE; BAPI_TRANSACTION_COMMIT; BAPI_BUS1077_SAVEFROMBUFFER
*& test_change_prop_data Changes the property data of a value assignment BAPI_BUS1077_GETDETAIL; BAPI_BUS1077_CHANGE; BAPI_TRANSACTION_COMMIT; BAPI_BUS1077_SAVEFROMBUFFER
*& test_del_ref Deletes all references of a specification BAPI_BUS1077_GETDETAIL; BAPI_BUS1077_DELETE; BAPI_TRANSACTION_COMMIT; BAPI_BUS1077_SAVEFROMBUFFER
*& The following methods are "help- methods" with different functionalities:
*& Method Short Description
*& set_dis_tab Adds one row the the displayed error-table
*& get_dis_tab Gets an error-table
*& set_dis_wa Fills one row of an error-table
*& set_dis_wa Gets one row of an error-table
*& get_random_matnr Gets a random matnr from dictionary
*& get_random_source Gets a random source from dictionary
*& get_random_phrase Gets a random source from dictionary (from given phrase selection set)
*& write_table_to_list Writes one table to display to list
*& Important variables:
*& Variable Short Description
*& l_return_tab Table for the errors to occure in BAPI-functions
*& l_dis_tab Error-table with data to display
*& Fields: function, function-description, error-description, edited specification
*& l_spec_key ID of the edited specification.
*& !!! helpfull technical information for BAPI usage !!!
*& Use F1-help for additional information.
The field "format_flag" in table "bapi1077df" exists not in every system
if the field doent exist, just delete the lines wich specify this data
BAPI strctures for specification- data:
additional information for function modules: addinf
return table (errors): bapiret2
specification header: bapi1077rh
identifier header: bapi1077ri
identifier Longtexts: bapi1077il
sublist assignments: bapi1077rl
property header: bapi1077vh
property usage: bapi1077du
property values: bapi1077va
property assessments: bapi1077dr
property components: bapi1077vp
property data: bapi1077pr
property freetexts: bapi1077df
property longtexts: bapi1077fl
property source: bapi1077ds
Used BAPI- Functions (examples):
All the tables for the data to set have to be prepared like
in the used methods.
Create new specification:
CALL FUNCTION 'BAPI_BUS1077_CREATE'
EXPORTING
key_date = addinf-valdat
change_number = addinf-aennr
flg_header = 'X'
flg_ident = 'X'
flg_ident_longtext = 'X'
flg_ident_sublist = 'X'
flg_prop_usage = 'X'
flg_prop_header = 'X' " These Flags specify the data to be edited
flg_prop = 'X'
flg_prop_rel = 'X'
flg_prop_comp = 'X'
flg_prop_data = 'X'
flg_prop_ftext = 'X'
flg_prop_ftext_longtext = 'X'
TABLES
return = l_return_tab " This table contains possible errors to occure
sub_header = l_sub_header_tab
ident_header = l_ident_header_tab
ident_longtext = l_ident_longtext_tab
ident_sublist = l_ident_sublist_tab
prop_usage = l_prop_usage_tab
prop_header = l_prop_header_tab " These tables contain the data to set
prop_val = l_prop_val_tab
prop_reliability = l_prop_assess_tab
prop_component = l_prop_component_tab
prop_data = l_prop_data_tab
prop_ftext = l_prop_ftext_tab
prop_ftext_longtext = l_prop_ftext_longtext_tab.
The following function works the same way:
BAPI_BUS1077_DELETE (delete specification or single data from specification)
Change specification data:
CALL FUNCTION 'BAPI_BUS1077_CHANGE'
EXPORTING
flg_ident_usage = 'X' " data to be changed
TABLES
return = l_return_tab
sub_header = l_sub_header_tab
ident_header = l_ident_header_tab
prop_usage = l_prop_usage_tab " table with changed data
prop_usagex = l_prop_usagex_tab. " table to specifiy wich fields are changed
After all these functions, the follwing two functions have
to be executed to commit the work and write the data from
the buffer to the dictionary (for details have a look at the used methods below):
BAPI_TRANSACTION_COMMIT(always set the wait-flag!)
BAPI_BUS1077_SAVEFROMBUFFER
Exceptions are the following functions to read data from specifications
and check if a specification exists.
These functions usually stand alone without "commit" and "save":
Get specification details:
CALL FUNCTION 'BAPI_BUS1077_GETDETAIL'
EXPORTING
key_date = addinf-valdat
change_number = addinf-aennr
flg_header = 'X'
flg_ident = 'X'
flg_ident_usage = 'X'
scenario = '1' "specifies the way, the data are read (F1-help for details)
TABLES
return = l_return_tab
sub_header = l_sub_header_tab
ident_header = l_ident_header_tab
prop_usage = l_prop_usage_tab.
Check if a specification exists:
CALL FUNCTION 'BAPI_BUS1077_EXISTENCECHECK'
EXPORTING
substanceid = l_spec_key "The spec-Key, that is searched for
key_date = addinf-valdat
TABLES
return = l_return_tab.
Helpful methods:
set_dis_tab: Fills the error-table to display for each test-method
get_random_matnr: Selects a random material-id from the dictionary, to work with
get_random_source: Selects a random source-id.
get_random_phrase: Selects a random phrase from given selection-set
report rc1_1077_bapi_example_change.
include cbui09.
type-pools: espap.
*& Include L1077P01
*& Include LC1F2P03
*& EHS ABAP UNIT TEMPLATE BACKUP
The methods with be called in this order:
class_setup
test1
test2
class_teardown
*& Class (Definition) lcl_aunit_template
Template for ABAP Unit
class lcl_bus1077_change_test definition.
type-pools: espph.
public section.
class-methods:
creates the two test-specifications with properties
class_setup,
deletes the two specifications
class_teardown,
test_change_comp,
This test changes the first component in the property
"Exact composition based on compound"
Prerequisites: Created specification which
has this property set. The test fails if the component's data
was not changed properly.
List of properties that are changed:
COMPCAT = 'EMULSIFIER'.
OPLOWLIMIT = '>'.
LOW_LIMIT = '0.15'.
OPUPPLIMIT = '<='.
UPP_LIMIT = '0.88'.
AVG_VAL = '0.88'.
EXPONENT = 'PPM'.
test_change_ident,
This test changes the first identifier of a specification
Prerequisites: Created specification which
has this property set. The test fails if the identifier
was not changed properly.
List of properties that are changed:
ID_TYPE = 'FRM'.
ID_CATEGRY = 'RAT'.
LANGU = 'E'.
IDENTIFIER = 'H2SO4'.
test_change_ident_longtext,
This test changes the identifier longtext of a specification
Prerequisites: Created specification which
has this property set. The test fails if the identifier longtext
was not changed properly.
List of properties that are changed:
Four lines of the identifier longtext are changed:
TEXT_LINE = 'Changed long text for ABAP Unit (LINE 1).'.
TEXT_LINE = 'Changed long text for ABAP Unit (LINE 2).'.
TEXT_LINE = 'Changed long text for ABAP Unit (LINE 3).'.
TEXT_LINE = 'Changed long text for ABAP Unit (LINE 4).'.
test_change_ident_usage,
This test changes the identifier usage of a specification
Prerequisites: Created specification which
has this property set. The test fails if the identifier usage
was not changed properly.
List of properties that are changed:
RATING = 'PUBLIC'.
VAL_AREA = 'REG_WORLD'.
EXCL_IND = FALSE.
ACT_IND = TRUE.
test_change_prop_usage,
This test changes the first property usage of a specification
Prerequisites: Created specification which
has this property set. The test fails if the property usage
was not changed properly.
List of properties that are changed:
RATING = 'PUBLIC'.
VAL_AREA = 'REG_WORLD'.
EXCL_IND = FALSE.
ACT_IND = TRUE.
test_change_subheader,
This test changes the sub header of a specification
Prerequisites: Created specification which
has this property set. The test fails if the sub header
was not changed properly.
List of properties that are changed:
SUBAUTHGRP = 'ALL'.
NOTE = 'Changed note!'.
SUBCHARACT = 'SUB_NOPOLY'.
test_ref_subs,
This test's purpose is to assure that specification references
can be created successfully.
Scenario:
1. Create 2 specifications(one with property values set, the other without)
2. Create a reference from the second spec to the first
3. Verify that the specifications have at least one property which
is the same - this will assure that the reference has been
created successfully
result: l_dis_tab_9
test_change_prop_ftext,
This test changes the property ftext & longtext of a specification
Prerequisites: Created specification which
has these properties set. The test fails if the UD longtext
was not changed properly.
List of properties that are changed:
User defined text:
USRDFNDTXT = 'Changed user-defined text for ABAP Unit (LINE 1).'.
FORMAT_FLAG = TRUE.
UD_TXTTYPE = 'RM'. " Remark
LANGU = 'EN'.
LONG_TEXT = TRUE.
Four lines of the UD longtext are changed:
TEXT_LINE = 'Changed user-defined long text for ABAP Unit (LINE 1).'.
TEXT_LINE = 'Changed user-defined long text for ABAP Unit (LINE 2).'.
TEXT_LINE = 'Changed user-defined long text for ABAP Unit (LINE 3).'.
TEXT_LINE = 'Changed user-defined long text for ABAP Unit (LINE 4).'.
test_change_assessment,
This test changes the assessment of a value assignment
Prerequisites: Created specification which:
- Has the predefined dafault property set. The test fails if the property assessment
don't change properly.
- List of properties that are changed:
ASSESSMENT = '2'.
test_change_prop_data,
This test changes the property data of a value assignment
Prerequisites: Created specification which:
- Has the predefined dafault property set. The test fails if the
property data doesn't change properly.
- Changed data:
CHAR_VALUE = <random phrase>.
test_read_usage_filter,
This test assures that the usage filter is working properly
Prerequisites: Created specification which:
- Has property usage set to PUBLIC/EU or PUBLIC/REG_WORLD.
This test has two scenarios:
1-st:
Read the value assignments with filter which should not find
any value assignments matching the criteria.
Criteria: INTERNAL/REG_WORLD
2-nd:
Read the value assignments with filter which should find
one value assignment matching the criteria.
Criteria: PUBLIC/ES
test_del_ref,
This test deletes all references of a specification
methods to edit the displayed table from l_return_tab
set_dis_tab
importing
i_table type bapiret2_t
i_wa type bapiret2
i_meth type c
i_tab_flg type c
i_func type c
i_func_desc type c
i_spec_key type c,
get_dis_tab
exporting
e_dis_tab type standard table,
set_dis_wa
importing
i_meth_wa type c
i_func_wa type c
i_func_desc_wa type c
i_error_desc_wa type c
i_spec_key_wa type c,
get_dis_wa
exporting
e_meth_wa type c
e_func_wa type c
e_func_desc_wa type c
e_error_desc_wa type c
e_spec_key_wa type c,
Gets matnumber of a random Matrial in DIC-Table "MAKT"
get_random_matnr
exporting
e_mat_nr type c,
Text of random source
get_random_source
exporting
e_source type c,
Random Phrase-text for given phrase selection set
get_random_phrase
importing
i_phrase_sel_set type c
exporting
e_phrase_id type c,
write_table_to_list
importing
i_method type c
i_dis_tab type standard table.
private section.
Class DATA:
class-data: sub_header_tab type standard table of bapi1077rh,
sub_header_wa like line of sub_header_tab.
class-data: spec_key like sub_header_wa-substance,
spec_key_pre like sub_header_wa-substance.
class-data va_recn type eserecn.
class-data: addinf type rcgaddinf.
class-data: scenario type bapistdtyp-scenario.
class-data: error_occured type i.
class-data: int_error_occured type i.
class-data: error_message2 type bapi_msg.
class-data: error_type type bapi_mtype.
class-data: error_section(100) type c.
Internal table, for displayed information
types:
begin of l_dis_rec,
meth(32) type c,
func(32) type c,
func_desc(64) type c,
error_desc(64) type c,
spec_key(12) type c,
end of l_dis_rec,
l_dis_type type l_dis_rec.
class-data:
l_dis_tab type table of l_dis_type,
l_dis_wa like line of l_dis_tab.
endclass. "lcl_BUS1077_change_test DEFINITIO
*& Global Data
types:
begin of lg_dis_rec,
meth(32) type c,
func(32) type c,
func_desc(64) type c,
error_desc(64) type c,
spec_key(12) type c,
end of lg_dis_rec,
lg_dis_type type lg_dis_rec.
data:
lg_dis_tab type table of lg_dis_type,
lg_dis_wa like line of lg_dis_tab.
Data for Dynpro
data:
ok_code like sy-ucomm,
ALV-Grid for method test_cr_all_spec_dtls_bylrs
g_container_1 type scrfname value 'BCALV_GRID_BAPI_EXPL',
grid1 type ref to cl_gui_alv_grid,
g_custom_container type ref to cl_gui_custom_container,
lg_fcat_tab type lvc_t_fcat,
lg_fcat_wa like line of lg_fcat_tab.
*& Prepare field catalogue for ALV-grids
lg_fcat_wa-fieldname = 'METH'.
lg_fcat_wa-inttype = 'C'.
lg_fcat_wa-outputlen = '32'.
lg_fcat_wa-coltext = text-007.
lg_fcat_wa-seltext = text-007.
append lg_fcat_wa to lg_fcat_tab.
lg_fcat_wa-fieldname = 'FUNC'.
lg_fcat_wa-inttype = 'C'.
lg_fcat_wa-outputlen = '32'.
lg_fcat_wa-coltext = text-008.
lg_fcat_wa-seltext = text-008.
append lg_fcat_wa to lg_fcat_tab.
lg_fcat_wa-fieldname = 'FUNC_DESC'.
lg_fcat_wa-inttype = 'C'.
lg_fcat_wa-outputlen = '64'.
lg_fcat_wa-coltext = text-009.
lg_fcat_wa-seltext = text-009.
append lg_fcat_wa to lg_fcat_tab.
lg_fcat_wa-fieldname = 'ERROR_DESC'.
lg_fcat_wa-inttype = 'C'.
lg_fcat_wa-outputlen = '64'.
lg_fcat_wa-coltext = text-010.
lg_fcat_wa-seltext = text-010.
append lg_fcat_wa to lg_fcat_tab.
lg_fcat_wa-fieldname = 'SPEC_KEY'.
lg_fcat_wa-inttype = 'C'.
lg_fcat_wa-outputlen = '12'.
lg_fcat_wa-coltext = text-011.
lg_fcat_wa-seltext = text-011.
append lg_fcat_wa to lg_fcat_tab.
*& Execute methods and write result to list
Execute methods...
lcl_bus1077_change_test=>class_setup( ).
lcl_bus1077_change_test=>test_change_subheader( ).
lcl_bus1077_change_test=>test_change_ident( ).
lcl_bus1077_change_test=>test_change_ident_usage( ).
lcl_bus1077_change_test=>test_change_prop_ftext( ).
lcl_bus1077_change_test=>test_change_prop_usage( ).
lcl_bus1077_change_test=>test_change_ident_longtext( ).
lcl_bus1077_change_test=>test_read_usage_filter( ).
lcl_bus1077_change_test=>test_ref_subs( ).
lcl_bus1077_change_test=>test_change_comp( ).
lcl_bus1077_change_test=>test_change_assessment( ).
lcl_bus1077_change_test=>test_change_prop_data( ).
lcl_bus1077_change_test=>test_del_ref( ).
lcl_bus1077_change_test=>class_teardown( ).
...get tables to display...
lcl_bus1077_change_test=>get_dis_tab( importing e_dis_tab = lg_dis_tab ).
*...and call Dynpro
call screen 100.
*& Class (Definition) aunit_template
class lcl_bus1077_change_test implementation.
method class_setup.
this method is called only once before all test methods
Local DATA:
data: addinf type rcgaddinf.
data: l_sub_header_tab type standard table of bapi1077rh,
l_sub_header_wa like line of l_sub_header_tab,
l_sub_header_pre_wa like line of l_sub_header_tab.
data: l_spec_key like l_sub_header_wa-substance,
l_spec_key_pre like l_sub_header_wa-substance,
l_spec_recn like l_sub_header_wa-record_no.
data: l_ident_header_tab type standard table of bapi1077ri,
l_ident_header_wa like line of l_ident_header_tab.
data: l_ident_recn like l_ident_header_wa-record_no.
data: l_ident_longtext_tab type standard table of bapi1077il,
l_ident_longtext_wa like line of l_ident_longtext_tab.
data: l_ident_sublist_tab type standard table of bapi1077rl,
l_ident_sublist_wa like line of l_ident_sublist_tab.
data: l_prop_usage_tab type standard table of bapi1077du,
l_prop_usage_wa like line of l_prop_usage_tab.
data: l_prop_usage_buf1 like l_prop_usage_wa,
l_prop_usage_buf2 like l_prop_usage_wa.
data: l_prop_header_tab type standard table of bapi1077vh,
l_prop_header_wa like line of l_prop_header_tab.
data: l_prop_subchacat like l_prop_header_wa-subchacat.
data: l_prop_val_tab type standard table of bapi1077va,
l_prop_val_wa like line of l_prop_val_tab.
data l_prop_val_recn like l_prop_val_wa-record_no.
data: l_prop_assess_tab type standard table of bapi1077dr,
l_prop_assess_wa like line of l_prop_assess_tab.
data: l_prop_component_tab type standard table of bapi1077vp,
l_prop_component_wa like line of l_prop_component_tab.
data: l_prop_data_tab type standard table of bapi1077pr,
l_prop_data_wa like line of l_prop_data_tab.
data: l_prop_ftext_tab type standard table of bapi1077df,
l_prop_ftext_wa like line of l_prop_ftext_tab.
data l_prop_ftext_recn like l_prop_ftext_wa-record_no.
data: l_prop_ftext_longtext_tab type standard table of bapi1077fl,
l_prop_ftext_longtext_wa like line of l_prop_ftext_longtext_tab.
data: l_prop_source_tab type standard table of bapi1077ds,
l_prop_source_wa like line of l_prop_source_tab.
data: l_return_tab type standard table of bapiret2,
l_return_wa like line of l_return_tab.
data: l_scenario type bapistdtyp-scenario.
data: l_phrase_id(30) type c,
l_source_id(10) type c.
1.1. create a new SPECIFICATION HEADER (pre) & verify the creation
prepare the a SPECIFICATION HEAD
refresh l_sub_header_tab.
clear l_sub_header_wa.
addinf-valdat = '20070125'. "key date 01/25/2007
clear addinf-aennr. "change number
l_sub_header_wa-primarykey = 1. "int. key
l_sub_header_wa-flgprimkey = true.
l_sub_header_wa-subcategry = 'REAL_SUB'. "spec. category
l_sub_header_wa-subauthgrp = 'ALL'. "spec. auth. group
append l_sub_header_wa to l_sub_header_tab.
call the BAPI function module to create specification
call function 'BAPI_BUS1077_CREATE'
exporting
key_date = addinf-valdat
change_number = addinf-aennr
flg_header = true
tables
return = l_return_tab
sub_header = l_sub_header_tab.
If errors occured, write them into l_dis_tab
call method set_dis_tab
exporting
i_table = l_return_tab
i_wa = l_return_wa
i_meth = 'class_setup'
i_tab_flg = true
i_func = 'BAPI_BUS1077_CREATE'
i_func_desc = text-000
i_spec_key = l_sub_header_wa-substance.
commit work
clear l_return_wa.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = true
importing
return = l_return_wa.
If errors occured, write them into l_dis_tab
call method set_dis_tab
exporting
i_table = l_return_tab
i_wa = l_return_wa
i_meth = 'class_setup'
i_tab_flg = false
i_func = 'BAPI_TRANSACTION_COMMIT'
i_func_desc = text-001
i_spec_key = l_sub_header_wa-substance.
remove locks (according to note 732628)
refresh l_return_tab.
call function 'BAPI_BUS1077_SAVEFROMBUFFER'
exporting
flg_luw_close_for_bapi = true
tables
return = l_return_tab.
If errors occured, write them into l_dis_tab
call method set_dis_tab
exporting
i_table = l_return_tab
i_wa = l_return_wa
i_meth = 'class_setup'
i_tab_flg = true
i_func = 'BAPI_BUS1077_SAVEFROMBUFFER'
i_func_desc = text-002
i_spec_key = l_sub_header_wa-substance.
prepare L_SUB_HEADER_TAB for BAPI_BUS1077_GETDETAIL
read table l_sub_header_tab
into l_sub_header_wa
index 1
transporting substance.
l_spec_key_pre = l_sub_header_wa-substance.
refresh l_sub_header_tab.
clear l_sub_header_wa.
l_sub_header_wa-substance = l_spec_key_pre.
append l_sub_header_wa to l_sub_header_tab.
set scenario
add espap_scenario-header_disp to l_scenario.
call the BAPI function module
refresh l_return_tab.
call function 'BAPI_BUS1077_GETDETAIL'
exporting
scenario = l_scenario
key_date = addinf-valdat
change_number = addinf-aennr
flg_header = true
tables
return = l_return_tab
sub_header = l_sub_header_tab.
clear buffer
refresh l_return_tab.
call function 'BAPI_BUS1077_CLEARBUFFER'
tables
return = l_return_tab.
If errors occured, write them into l_dis_tab
call method set_dis_tab
exporting
i_table = l_return_tab
i_wa = l_return_wa
i_meth = 'class_setup'
i_tab_flg = true
i_func = 'BAPI_BUS1077_GETDETAIL'
i_func_desc = text-003
i_spec_key = l_sub_header_wa-substance.
read the newly cretated SUB. RECORD NUMBER
read table l_sub_header_tab
into l_sub_header_wa
index 1
transporting record_no
substance.
l_spec_recn = l_sub_header_wa-record_no.
spec_key_pre = l_sub_header_wa-substance.
2.1. Prepare all specification detail data for new creation
prepare the new SPECIFICATION HEADER
refresh: l_sub_header_tab.
clear l_sub_header_wa.
addinf-valdat = '20070125'. "key date 01/25/2007
clear addinf-aennr. "change number
l_sub_header_wa-primarykey = 2. "int. key
l_sub_header_wa-flgprimkey = true.
l_sub_header_wa-subcategry = 'LIST_SUB'. "spec. category
l_sub_header_wa-subauthgrp = 'ALL'. "spec. auth. group
append l_sub_header_wa to l_sub_header_tab.
prepare the new IDENTIFIER HEADER
refresh: l_ident_header_tab.
clear l_ident_header_wa.
l_ident_header_wa-primarykey = 21. "int. key
l_ident_header_wa-flgprimkey = true.
l_ident_header_wa-foreignkey = l_sub_header_wa-primarykey.
l_ident_header_wa-flgfrgnkey = l_sub_header_wa-flgprimkey.
l_ident_header_wa-id_type = 'NAM'. "ident.'s type
l_ident_header_wa-id_categry = 'PROD'. "ident.'s category
l_ident_header_wa-langu = 'E'. "ident.'s language
l_ident_header_wa-identifier = 'Test for ABAP Unit'. "#EC *
append l_ident_header_wa to l_ident_header_tab.
l_ident_header_wa-long_text = true.
prepare the IDENTIFIER LONGTEXT
refresh: l_ident_longtext_tab.
clear l_ident_longtext_wa.
l_ident_longtext_wa-primarykey = 211. "int. key
l_ident_longtext_wa-flgprimkey = true.
l_ident_longtext_wa-foreignkey = l_ident_header_wa-primarykey.
l_ident_longtext_wa-flgfrgnkey = l_ident_header_wa-flgprimkey.
l_ident_longtext_wa-text_line = 'Test long text for ABAP Unit (LINE 1).'. "#EC NOTEXT
l_ident_longtext_wa-format_col = '*'.
l_ident_longtext_wa-loglockmod = true.
append l_ident_longtext_wa to l_ident_longtext_tab.
l_ident_longtext_wa-primarykey = 212. "int. key
l_ident_longtext_wa-text_line = 'Test long text for ABAP Unit (LINE 2).'. "#EC NOTEXT
append l_ident_longtext_wa to l_ident_longtext_tab.
l_ident_longtext_wa-primarykey = 213. "int. key
l_ident_longtext_wa-text_line = 'Test long text for ABAP Unit (LINE 3).'. "#EC NOTEXT
append l_ident_longtext_wa to l_ident_longtext_tab.
l_ident_longtext_wa-primarykey = 214. "int. key
l_ident_longtext_wa-text_line = 'Test long text for ABAP Unit (LINE 4).'. "#EC NOTEXT
append l_ident_longtext_wa to l_ident_longtext_tab.
prepare the IDENTIFIER SUBLIST
refresh: l_ident_sublist_tab.
clear l_ident_sublist_wa.
l_ident_sublist_wa-primarykey = 215. "int. key
l_ident_sublist_wa-flgprimkey = true.
l_ident_sublist_wa-foreignkey = l_ident_header_wa-primarykey.
l_ident_sublist_wa-flgfrgnkey = l_ident_header_wa-flgprimkey.
l_ident_sublist_wa-valid_from = '20070125'. "date 01/25/2007
l_ident_sublist_wa-valid_to = '20080125'. "date 01/25/2008
l_ident_sublist_wa-sublist = 'EINECS'.
append l_ident_sublist_wa to l_ident_sublist_tab.
prepare the IDENTIFIER USAGE
refresh: l_prop_usage_tab.
clear l_prop_usage_wa.
l_prop_usage_wa-primarykey = 216. "int. key
l_prop_usage_wa-flgprimkey = true.
l_prop_usage_wa-foreignkey = l_ident_header_wa-primarykey.
l_prop_usage_wa-flgfrgnkey = l_ident_header_wa-flgprimkey.
l_prop_usage_wa-mastertabl = 'ESTRI'.
l_prop_usage_wa-rating = 'PUBLIC'.
l_prop_usage_wa-val_area = 'REG_EU'.
l_prop_usage_wa-excl_ind = false.
l_prop_usage_wa-act_ind = true.
append l_prop_usage_wa to l_prop_usage_tab.
prepare the PROPERTY HEADER
refresh: l_prop_header_tab.
clear l_prop_header_wa.
l_prop_header_wa-primarykey = 22. "int. key
l_prop_header_wa-flgprimkey = true.
l_prop_header_wa-foreignkey = l_sub_header_wa-primarykey.
l_prop_header_wa-flgfrgnkey = l_sub_header_wa-flgprimkey.
l_prop_header_wa-subchacat = 'SAP_EHS_1012_015'. "Chemical Characterization
append l_prop_header_wa to l_prop_header_tab.
prepare the VALUE tab
refresh: l_prop_val_tab.
clear l_prop_val_wa.
l_prop_val_wa-primarykey = 221.
l_prop_val_wa-flgprimkey = true.
l_prop_val_wa-foreignkey = l_prop_header_wa-primarykey.
l_prop_val_wa-flgfrgnkey = l_prop_header_wa-flgprimkey.
l_prop_val_wa-sequence = 1.
append l_prop_val_wa to l_prop_val_tab.
prepare the VALUE ASSIGNMENT ASSESSMENT tab
refresh: l_prop_assess_tab.
clear l_prop_assess_wa.
l_prop_assess_wa-primarykey = 2211.
l_prop_assess_wa-flgprimkey = true.
l_prop_assess_wa-foreignkey = l_prop_val_wa-primarykey.
l_prop_assess_wa-flgfrgnkey = l_prop_val_wa-flgprimkey.
l_prop_assess_wa-assessment = '1'.
append l_prop_assess_wa to l_prop_assess_tab.
Get random phrase-text
call method get_random_phrase
exporting
i_phrase_sel_set = 'SAP_EHS_1012_015_REMARK'
importing
e_phrase_id = l_phrase_id.
prepare the VALUE ASSIGNMENT DATA tab
refresh: l_prop_data_tab.
clear l_prop_data_wa.
l_prop_data_wa-primarykey = 2212.
l_prop_data_wa-flgprimkey = true.
l_prop_data_wa-foreignkey = l_prop_val_wa-primarykey.
l_prop_data_wa-flgfrgnkey = l_prop_val_wa-flgprimkey.
l_prop_data_wa-char_value = l_phrase_id.
l_prop_data_wa-name_char = 'SAP_EHS_1012_015_REMARK'. "Chemical Characterization
l_prop_data_wa-oper_inc = 0.
append l_prop_data_wa to l_prop_data_tab.
prepare the VALUE ASSIGNMENT COMPONENT tab
refresh: l_prop_component_tab.
clear l_prop_component_wa.
l_prop_component_wa-primarykey = 2213.
l_prop_component_wa-flgprimkey = true.
l_prop_component_wa-foreignkey = l_prop_val_wa-primarykey.
l_prop_component_wa-flgfrgnkey = l_prop_val_wa-flgprimkey.
l_prop_component_wa-comproot = l_spec_recn.
l_prop_component_wa-compcat = 'ACT_AGENT'.
l_prop_component_wa-sequence = 1.
l_prop_component_wa-oplowlimit = '>'.
l_prop_component_wa-low_limit = '0.55'.
l_prop_component_wa-opupplimit = '<='.
l_prop_component_wa-upp_limit = '0.88'.
l_prop_component_wa-avg_val = '0.88
Maybe you are looking for
-
I cannot map a windows 2008 shared drive into mac 10.5.8
Hi Support, I have tried to map a shared drive from windows 2008 x64 on to Mac 10.5.8. however, it is unsuccessful and it prompts "the file server is running on your machine.Please access the volumes and files locally." after i clicked ok, it prompts
-
Pricing condition type and the procedure it belongs to
Hello Experts, Pricing is found in basic function in spro. Under this we maintain the condition types. But how does the SAP system know for which pricing procedure a condition type belongs? Is a condition type uniquely usable by 1 pricing procedure o
-
I need an oracle appsvr of previous version(which can work with 8.1.7))
where can i download it? thx
-
How to Use Oracle Coherence in BPEL 11g
i have a scenario to cache the results some where, so that i can make use of the same for the same request. I hope this can be done using Oracle Coherence. Could you please let me know how can i use this coherence for cacheing in BPEL 11g (in my bpel
-
RemoteApp's not running when accessed from the internet
Hi TP, Hopefully someone can help me here. I've installed RDWeb on the RDG server which live in our DMZ - I can access and log on to RDS from the internet with the RDG FQDN remote.external.com but I can't launch any RemoteApp's. Basically there's no