How to create metheds in abap
Hi All,
Can anybody help me to know how create methods in abap and whats is the perpose of these methods. Any documentation is helpful. Thanks..
Regards,
Kalpana
Hi,
Check the program demo_abap_objects_methods for methods..
CLASS MY_CLASS DEFINITION.
PUBLIC SECTION.
METHODS: ADDITION IMPORTING IP_1 TYPE INT4
IP_2 TYPE INT4
EXPORTING OP_1 TYPE INT4,
SUBTRACTION IMPORTING IP_1 TYPE INT4
IP_2 TYPE INT4
EXPORTING OP_1 TYPE INT4.
ENDCLASS.
CLASS MY_CLASS IMPLEMENTATION.
METHOD ADDITION.
OP_1 = IP_1 + IP_2.
ENDMETHOD.
METHOD SUBTRACTION.
OP_1 = IP_1 - IP_2.
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
DATA: OBJ TYPE REF TO MY_CLASS.
CREATE OBJECT OBJ.
DATA: V_OUTPUT TYPE INT4.
CALL METHOD OBJ->ADDITION EXPORTING IP_1 = 1
IP_2 = 3
IMPORTING OP_1 = V_OUTPUT.
WRITE: / V_OUTPUT.
Thanks,
Naren
Similar Messages
-
How to create popup in ABAP webdynpro.
Hi,
I found lot of examples to create a popup/ model window for java webdynpro.
Could anyone give a pointer to an example which explains how to create popup in ABAP webdynpro??
Kind Regards
ShahulHi Thomas:
It worked fine the 1st time. Second time when the user clicks on the button to open up the popup it dumps.
Here is the code in the action for popup:
data: l_cmp_api type ref to if_wd_Component,
l_window_manager type ref to if_wd_window_manager,
l_api type ref to if_wd_View_controller,
l_text type string_table.
l_cmp_api = wd_comp_controller->wd_get_api( ).
l_window_manager = l_cmp_api->get_window_manager( ).
if wd_this->m_popup is initial.
wd_this->m_popup = l_window_manager->create_window(
window_name = 'DOCQSOW'
button_kind = if_wd_window=>co_buttons_ok
message_type = if_wd_window=>co_msg_type_none ).
component_usage_name = 'DOCQUERY_USAGE_1'
l_api = wd_this->wd_get_api( ).
wd_this->m_popup->subscribe_to_button_event(
button = if_wd_window=>co_button_ok
button_text = 'Transfer'
action_name = 'POPUP_CLOSED'
action_view = l_api ) .
wd_this->m_popup->SET_REMOVE_ON_CLOSE( abap_true ).
endif.
wd_this->m_popup->open( ).
Second time when the popup tries to open, I get the following error:
Method: RENDER_WINDOW of program CL_WDR_WINDOW_RENDERER========CP
Method: RENDER_WINDOW of program CL_WDR_CLIENT_SSR=============CP
Method: RENDER_POPUP_WINDOWS of program CL_WDR_CLIENT_SSR=============CP
Method: RENDER_WINDOWS of program CL_WDR_CLIENT_SSR=============CP
Method: IF_WDR_RESPONSE_RENDERER~RENDER_VIEWS of program CL_WDR_CLIENT_SSR=============CP
Method: IF_WDR_RESPONSE_RENDERER~RENDER_USER_INTERFACE_UPDATES of program CL_WDR_CLIENT_SSR=============CP
Method: IF_WDR_CLIENT~SEND_RESPONSE of program CL_WDR_CLIENT_ABSTRACT_HTTP===CP
Method: IF_WDR_CLIENT~SEND_RESPONSE of program CL_WDR_CLIENT_SSR=============CP
Method: EXECUTE of program CL_WDR_MAIN_TASK==============CP
Method: IF_HTTP_EXTENSION~HANDLE_REQUEST of program CL_WDR_MAIN_TASK==============CP
Is there a way to destroy the instance of the m_popup?
Any help is appreciated!
Thanks -
How to create webservice for abap RFC
how to create webservice for abap RFC.......................
plz any could tel meI'll answer my own question...
In SE80 you create the Function Group and something called a Virtual End Point. These are the only items that transport forward to you QA and eventually your production system. Everything else has to be created in SOAMANAGER on the target systems.
In Development in SE80, when you create the Virtual End Point, this creates a corresponding entry visible in transaction SICF. When you are done in SOAMANAGER, it creates three more entries in SICF. The process of transporting the Virtual End Point does NOT create any entries in SICF in QA. Don't let this be confusing. In QA, SOAMANAGER will create all four SICF entries.
Also, if you try to secure the web services using the S_SERVICE object, you must actually test the web service before you can add it to any roles. This is because the USOBHASH table is not populated for the web service until you actually run the web service for the first time. -
How to create pakage in abap.
1) How to create the pakage in abap.
Edited by: Matt on Mar 10, 2009 3:10 PM - modified subjectHi Ganga,
Follow these steps :
1. Run the SE80 T-code in the R/3 system.
2. Click on Edit Objects option on the top of the window.
3. Select "Development Coordination" in the Object selection window.
4. Select "Package" radio button and provide the package name(like any name: "BIDEV").
5. Click on "Create" icon.
6. Fill the required details ( Short description, Appli.Component, Software Component)
7. Select "SAVE" Icon.
Go through the link below for fruther help :
http://www.sap-img.com/basis/steps-for-creating-package.htm
Hope the information is very helpful!
Regards,
Kittu -
ABAP Queary Or SAP Queary Doc/ How to Create Tcode for ABAP queary report
Hi All,
Please send the documentation on ABAP Queary.
How to create transaction code Report developed using ABAP Queary.
Regards
sudheerHi,
Check out these links.
http://help.sap.com/saphelp_46c/helpdata/en/35/26b413afab52b9e10000009b38f974/content.htm
http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Introduction.asp
Step-by-step guide for creating ABAP query
http://www.sappoint.com/abap/ab4query.pdf
ABAP query is mostly used by functional consultants.
SAP Query
Purpose
The SAP Query application is used to create lists not already contained in the SAP standard system. It has been designed for users with little or no knowledge of the SAP programming language ABAP. SAP Query offers users a broad range of ways to define reporting programs and create different types of reports such as basic lists, statistics, and ranked lists.
Features
SAP Query's range of functions corresponds to the classical reporting functions available in the system. Requirements in this area such as list, statistic, or ranked list creation can be met using queries.
All the data required by users for their lists can be selected from any SAP table created by the customer.
To define a report, you first have to enter individual texts, such as titles, and select the fields and options which determine the report layout. Then you can edit list display in WYSIWYG mode whenever you want using drag and drop and the other toolbox functions available.
ABAP Query, as far as I Believe, is the use of select statements in the ABAP Programming. This needs a knowledge of Open SQL commands like Select,UPdtae, Modify etc. This has to be done only by someone who has a little bit of ABAP experience.
To sum up, SAP queries are readymade programs given by SAP, which the user can use making slight modification like the slection texts, the tables from which the data is to be retrieved and the format in which the data is to be displayed.ABAP queries become imperative when there is no such SAP query existing and also when there is a lot of customizing involved to use a SAP Query directly -
How to create objects in ABAP Webdynpro?
Hi,
I want to create the object for the class: <b>CL_GUI_FRONTEND_SERVICES.</b>
then i want to call file_save_dialog method.
how shoud i write the code, plz?I have written this code:
v_guiobj TYPE REF TO cl_gui_frontend_services.
<u> ?????????????</u>
v_guiobj->file_save_dialog( ...).
How to create object in the place of ?????????????.
Bcoz, when i run this i am getting:
<b>Access via Null object reference not possible.</b> -
How to create Spool through ABAP program
How to create spool request for Smartforms through program. So I can go in TCODE SP01 and see the output of my smartforms.
Include the below code in ur program .......
DATA: PRINT_PARAMETERS TYPE PRI_PARAMS,
VALID_FLAG TYPE C LENGTH 1.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
IMMEDIATELY = 'X' "C_IMMEDIATELY
*LAYOUT = 'Z_48_144'
*LINE_COUNT = '48'
LINE_SIZE = '255'
*NEW_LIST_ID = C_NEW_LIST_ID
NO_DIALOG = 'X'
RELEASE = 'X'
IMPORTING
OUT_PARAMETERS = PRINT_PARAMETERS
VALID = VALID_FLAG
EXCEPTIONS
ARCHIVE_INFO_NOT_FOUND = 1
INVALID_PRINT_PARAMS = 2
INVALID_ARCHIVE_PARAMS = 3
OTHERS = 4 .
G_PDEST = PRINT_PARAMETERS-PDEST.
NEW-PAGE PRINT ON PARAMETERS PRINT_PARAMETERS
NO DIALOG.
List of write statements to be output.......
NEW-PAGE PRINT OFF.
Reward if useful.............. -
Plz tell me the syntax
Go through this
SELECTION-SCREEN - PUSHBUTTON
Syntax
SELECTION-SCREEN PUSHBUTTON [/][pos](len) button_text
USER-COMMAND fcode
[VISIBLE LENGTH vlen]
[MODIF ID modid]
[ldb_additions].
Extras:
1. ... [/][pos](len)
2. ... USER-COMMAND fcode
3. ... VISIBLE LENGTH vlen
4. ... MODIF ID modid
Effect
This statement creates a pushbutton on the current selection screen. The text on the pushbutton is determined by the content of button_text. The rules that apply to text also apply to button_text when creating an output field.
The additions ldb_additions can only be used in the selection include for a logical database.
Notes
You can use the function module ICON_CREATE to assign an icon, a quick info text and a corresponding text to a pushbutton. When you do this, you must specify an adequate length len for the pushbutton so that the icon can be displayed internally and adjust the visible length with VISIBLE LENGTH.
Once the event block in AT SELECTION-SCREEN has been processed, the system usually returns to displaying the selection screen. To exit selection screen processing and continue executing the program, you can only choose Execute or Cancel. This means pushbuttons on selection screens are intended primarily for use for dynamic modifications to the selection screen rather than to control the program.
Addition 1
... [/][pos](len)
Effect
You must specify the position of the output field using [/][pos](len). The syntax and meaning of [/][pos](len) are the same as when creating horizontal lines, although in this case, len defines the length of the pushbutton on the selection screen. If a pushbutton extends beyond position 83 or beyond the edge of a block with a frame, it is cut off at the right hand side.
Addition 2
... USER-COMMAND fcode
Effect
If you specify the USER-COMMAND addition, the pushbutton must be assigned a function code fcode. The function code fcode must be specified directly and can only contain a maximum of 20 characters.
Before you can work with the pushbutton, you must specify a TABLES statement to declare an interface work area for the structure SSCRFIELDS from the ABAP Dictionary.
If the user selects the pushbutton on the selection screen, the runtime environment triggers the event AT SELECTION-SCREEN and the function code fcode is transferred to the ucomm component in the interface work area sscrfields.
Note
If the function code of a pushbutton corresponds to a function code used in the GUI status of the selection screen, the selection screen processing is influenced accordingly.
Addition 3
... VISIBLE LENGTH vlen
Effect
The VISIBLE LENGTH addition defines the visible length vlen of the pushbutton and your text. The syntax and meaning of this addition are the same as when creating output fields, although a pushbutton is never displayed as shorter than the text defined for it.
Addition 4
... MODIF ID modid
Effect
The MODIF ID addition assigns the pushbutton to the modification group modid that is assigned to the column group1 on the system table screen. This means it can be modified using a MODIFY SCREEN statement before the selection screen is displayed.
Example
Define and access a stand-alone selection screen 500 with two pushbuttons in an executable program. An icon and a quick info text are created for the second pushbutton.
TABLES sscrfields.
TYPE-POOLS icon.
SELECTION-SCREEN:
BEGIN OF SCREEN 500 AS WINDOW TITLE title,
PUSHBUTTON 2(10) but1 USER-COMMAND cli1,
PUSHBUTTON 12(30) but2 USER-COMMAND cli2
VISIBLE LENGTH 10,
END OF SCREEN 500.
AT SELECTION-SCREEN.
CASE sscrfields.
WHEN 'CLI1'.
WHEN 'CLI2'.
ENDCASE.
START-OF-SELECTION.
title = 'Push button'.
but1 = 'Button 1'.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
name = icon_information
text = 'Button 2'
info = 'My Quickinfo'
IMPORTING
RESULT = but2
EXCEPTIONS
OTHERS = 0.
CALL SELECTION-SCREEN '0500' STARTING AT 10 10.
THnaks
Ankur Sharma -
How to create "service group" (ABAP webservice consumer) for SOAMANAGER
HI experts,
I'm trying to setup ABAP as a proper webservice consumer using SOAMANAGER in a 7.01 system. I would like to use Business Scenario Communication for this. I want to add Service Groups in the Consumer tab, and I find 2 servicegroups in the 7.01 (ERP 6.04) system: SRT_SG_TEST_01 and SRT_TEST_GROUP. However, I want to create my own Serivce Groups (Consumer), where do I do that? SE80?
All help appreciated, please don't bother describing the ABAP-as-Provider setup, which is the more common approach.
Gr, WoutHi ganesh,
Please look at the SAP note 376424 - BAPI_PO_CREATE1: Error messages for parked POs.
Sap recommends to install the support service pack. Take a look at the note for detailed understanding.
Also take a look at SAP NOte
767284 - SE518 occurs although account assignment is supplied to BAPI (this requires Note 552114 must be applied as a prerequisite)
Consider contacting basis team after your analysis about the issue.
Regards,
Sivaganesh -
How to create Web dynpro ABAP iview in EP ?
Hi guys,
I have created Web dynpro iview in EP but when I execute it I'm getting errpr msg.
page cann't display.
Application neme= correct
namespace= correct
System allias=correct.
Could u plz tell me where is the problem?
Thanks
Prakash
Edited by: Prakash Rout on May 12, 2009 9:39 AMHii ,
Check this article for settings of Web dynpro abap iview, might be helpful
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0235c19-9493-2b10-64a5-8487b23a7a41
Hope it helps..
Sonal... -
Any advice / guide on how to create separate Stack ABAP + JAVA for CTS+
Hello Experts,
Can you please point me to the how to guide for creation of separate Stacks ABAP + JAVA for CTS+ Transport Management.
Also can you please clarify how I can convert STMS Virtual systems in to Real systems? Any guidance for this?
Thank youHello,
You should have a look at the installation guide.
http://service.sap.com/instguides -> SAP Components -> SAP Solution Manager -> Release XXX
For instance :
http://service.sap.com/instguides -> SAP Components -> SAP Solution Manager -> Release 7.0 EHP 1
Then have a look at section 4.2 Installation Checklist u2014 Java Add-In
It covers:
Java Add-In for an existing central ABAP system
Java Add-In for an existing distributed ABAP system
Java Add-In for an existing High-Availability ABAP system
ABAP+Java Dialog instance
Regards,
Paul -
How to create breakpoint with ABAP code?
Hi all,
I would like to create a breakpoint for my user id only.
So far, the only way that I know is by:
break <user_id>.
e.g.
break john.
HOWEVER, my user id contain a "." (i.e. chris.p) , and this cause syntax error.
Could anyone help me?
Thank you.
Best regards,
ChrisHi chris.
greetings
try like this:-
if sy-uname = 'CHRIS.P'.
break-point.
endif.
if helpful, plz reward points.
regards
prashant -
How to create a node with attributes at runtime in webdynpro for ABAP?
Hi Experts,
How to create a node with attributes at runtime in webdynpro for ABAP? What classes or interfaces I should use? Please provide some sample code.
I have checked IF_WD_CONTEXT_NODE_INFO and there is ADD_NEW_CHILD_NODE method. But this is not creating any node. I this this creates only a "node info" object.
I even check IF_WD_CONTEXT_NODE but i could not find any method that creates a node with attribute.
Please help!
Thanks
GopalHi
I am getting the following error while creating a dynamic context node with 2 attributes. Please help me resolve this problem.
Note
The following error text was processed in the system PET : Line types of an internal table and a work area not compatible.
The error occurred on the application server FMSAP995_PET_02 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: IF_WD_CONTEXT_NODE~GET_STATIC_ATTRIBUTES_TABLE of program CL_WDR_CONTEXT_NODE_VAL=======CP
Method: GET_REF_TO_TABLE of program CL_SALV_WD_DATA_TABLE=========CP
Method: EXECUTE of program CL_SALV_WD_SERVICE_MANAGER====CP
Method: APPLY_SERVICES of program CL_SALV_BS_RESULT_DATA_TABLE==CP
Method: REFRESH of program CL_SALV_BS_RESULT_DATA_TABLE==CP
Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE_DATA of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_COMP_TABLE_DATA~UPDATE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_VIEW~MODIFY of program CL_SALV_WD_C_TABLE_V_TABLE====CP
Method: IF_SALV_WD_COMPONENT~VIEW_MODIFY of program CL_SALV_WD_A_COMPONENT========CP
My code is like the following:
TYPES: BEGIN OF t_type,
CARRID TYPE sflight-carrid,
CONNID TYPE sflight-connid,
END OF t_type.
Data: i_struc type table of t_type,
dyn_node type ref to if_wd_context_node,
rootnode_info type ref to if_wd_context_node_info,
i_node_att type wdr_context_attr_info_map,
wa_node_att type line of wdr_context_attr_info_map.
wa_node_att-name = 'CARRID'.
wa_node_att-TYPE_NAME = 'SFLIGHT-CARRID'.
insert wa_node_att into table i_node_att.
wa_node_att-name = 'CONNID'.
wa_node_att-TYPE_NAME = 'SFLIGHT-CONNID'.
insert wa_node_att into table i_node_att.
clear i_struc. refresh i_struc.
select carrid connid into corresponding fields of table i_struc from sflight where carrid = 'AA'.
rootnode_info = wd_context->get_node_info( ).
rootnode_info->add_new_child_node( name = 'DYNFLIGHT'
attributes = i_node_att
is_multiple = abap_true ).
dyn_node = wd_context->get_child_node( 'DYNFLIGHT' ).
dyn_node->bind_table( i_struc ).
l_ref_interfacecontroller->set_data( dyn_node ).
I am trying to create a new node. That is
CONTEXT
- DYNFLIGHT
CARRID
CONNID
As you see above I am trying to create 'DYNFLIGHT' along with the 2 attributes which are inside this node. The structure of the node that is, no.of attributes may vary based on some condition. Thats why I am trying to create a node dynamically.
Also I cannot define the structure in the ABAP dictionary because it changes based on condition
Message was edited by: gopalkrishna baliga -
Web dynpro for abap how to create a customize search help in alv column
hi:
Web dynpro for abap how to create a customize search help in alv column and put search help value into alv column?
Are there specific examples ?
thanks!!HI:
I want to created a freely programed help which include date&time,and put help value to alv column.
I have created a freely programed help in web dynpro for abpa application,I refer:
**************** - WebDynpro for ABAP
but have a problem!
If you focus on the the input field in the first row, you get the value help
However if I go to the second row and focus on the same input field in this column, I don't get the value help:
What is a good way to solve similar problems?
thanks -
How to create a bapi to update and add record 2 abap r3 table created by me
i have created a abap r3 table and i now want to insert records into it through SAP netweaver(Web-Dynpro). So i need a bapi to udate and insert records in the abap r3 table.if someone can please tell me how to create the bapi..coz i handel the EP part and dont know much about abap.
BAPIs are defined as API methods of SAP business object types.
A BAPI is implemented as a function module, that is stored and described in the Function Builder.
To create BAPI you are supposed to do following steps :
1) create package in SE80.
2) create function group in SE80.
3) create function module in SE37(REMOTE ENABLE) & relased it .
write your logic in that FM.
4) Go in SWO1 to create Object type / object name (write the program name which is SE38 program generated in background )
5) Then go to SWO1
Utilities -> Api methods -> ADD method
write the name of FM which you have created & continue.
6) select your method
a) EDIT -> change release status -> object type -> implement
-> released
b) EDIT -> change release status -> object type component-> implement
-> released
7) go in BAPI & you will get your BAPI.
Maybe you are looking for
-
How to get the WorkInstruction from a hook context
Hi, i have a PRE_BATCH_START hook and i would like to get the work instruction for the operation that this hook is on. Is there an API to somehow read the content of the work instruction? Using ME 6.0.2.2.12 Thanks in advance, David
-
Itunes has encontered an error and needs to close
Windows xp pro. install itunes fine but everytime i come to running it. it comes up with that error its runing sp2, no firewall's are turned on. Any help please i would be very gr8 full. if i could get hold of a copy of itunes 5 i might try that
-
Messages won't sign-in to gchat or aim after waking from sleep.
I have installed the Messages beta and occasionally I cannot connect to the Jabber or AIM servers for GChat and AIM. Sometimes I will be randomly booted from the servers while connected. Currently when I woke my computer from sleep I choose to connec
-
Why having problem after updating to IOS 7?
My unit is Iphone 5 and bought it 3rd week of August with serial no. F1*******TWF. Recently, I updated to IOS 7. After updating I am having problem downloading applications like Candy Crush, Chikka Messenger and etc. Whenever I download apps it
-
What are all these duplicates in iTunes 11?
Why am I seeing all these duplicates in an album in iTunes 11? How can I get rid of them? Why do some have download from iCloud buttons? I don't want to think. What's going on here. What has Apple done to a nice simple interface? doug