Calling LSMW from a program
Hi,
Is it possible to call an LSMW from a z program?
Thanks.
Hi,
LSMW is done seperately with its
Project
Subproject and
Object name , u can call it using call transaction lsmw onlu
reward poitns if helpful
Similar Messages
-
Is it possible to call website from ABAP Program?
Hi Experts,
Is it possible to call website from ABAP Program?
It is very Urgent Help me.
Regards,
Ashok.Hi,
Check the following program:
REPORT ZURL NO STANDARD PAGE HEADING.
DATA: BEGIN OF URL_TABLE OCCURS 10,
L(25),
END OF URL_TABLE.
URL_TABLE-L = 'http://www.lycos.com'.APPEND URL_TABLE.
URL_TABLE-L = 'http://www.hotbot.com'.APPEND URL_TABLE.
URL_TABLE-L = 'http://www.sap.com'.APPEND URL_TABLE.
LOOP AT URL_TABLE.
SKIP. FORMAT INTENSIFIED OFF.
WRITE: / 'Single click on '.
FORMAT HOTSPOT ON.FORMAT INTENSIFIED ON.
WRITE: URL_TABLE. HIDE URL_TABLE.
FORMAT HOTSPOT OFF.FORMAT INTENSIFIED OFF.
WRITE: 'to go to', URL_TABLE.
ENDLOOP.
CLEAR URL_TABLE.
AT LINE-SELECTION.
IF NOT URL_TABLE IS INITIAL.
CALL FUNCTION 'WS_EXECUTE'
EXPORTING
program = 'C:\Program Files\Internet Explorer\IEXPLORE.EXE'
commandline = URL_TABLE
INFORM = ''
EXCEPTIONS
PROG_NOT_FOUND = 1.
IF SY-SUBRC <> 0.
WRITE:/ 'Cannot find program to open Internet'.
ENDIF.
ENDIF.
Regards,
Bhaskar -
How to call LSMW from a Report program
Hi,
I have a requirment of extending vendor master data (Companycode data and Purchasing Organization data ) through Tcode XK02 using LSMW.Also I need to generate an error log file for validating the data from flat file and must have an export option of the error log file.
Can you help me how to proceed on this in steps.
Also pls let me know how to call LSMW transaction through a Report.
Based on the selection criteria I need to maintain two source structues,one for companycode data and the other for Purchasing Orgnization data for uploading data thru LSMW.How to do this?
pls respond ASAP,
Thanks,
NagendraHi,
create 2 LSMW object (under same project and subproject)..
one for extended vendor master data for company code data and other for extended purchase organization data for company code data.
Now check the radio buttons and based on that populate ur LSMW object.
Store project
project = < >.
Store subproject
subproj = < >.
Store object
object = '6GSC022_TS3'.
if r_ccode = 'X'.
Store object
object = < >.
else.
Store object
object = < >.
endif.
Call the function module to display object (LSMW) maintenance screen
CALL FUNCTION '/SAPDMC/LSM_OBJ_STARTER'
EXPORTING
project = project
subproj = subproj
object = object
EXCEPTIONS
no_such_object = 1
OTHERS = 2.
Generating error log:
After the checking the field if u think for this u need to generate error message then In the Maintain Field Mapping and Conversion Rules option under the required field write the following code:
data: v_msgtxt(100) type c.
message <msg ID> <message type> <message no>
with <var1> <var2>
into v_msgtxt.
write v_msgtxt.
Follow the next step in LSMW object till you reach the option Convert Data.
After you execute this option you will get the desired message here.
Regards,
Joy. -
Call LSMW from a Module pool screen
Hi SAP gurus,
In order to call an LSMW from a module pool screen, there is a Function module which I have used earlier, but unable to recollect it. Can someone please tell me the FM which we need to use ?Sudhakar,
Create an LSMW and assign it to a tcode and then call this tcode from the module pool program so that it will skip all the screens just by allowing the user to input the files and run the lswm.
Regarding the FM I have no idea.
K.Kiran. -
Hello, everyone.
This is my first post, so i hope i'm doing it right.
I'm using Transaction LSMW to create mass vendors with this input parameters:
Project: FI
Subproject: AP
Object: VENDOR_02
It works fine, with the standar steps and a plain text file.
What i'm asked to do is create a WebService that uses this transaction to communicate BizAgi (a BPM) and SAP. The problem is that i don't know how to call this transaction from the RFC. are there any suggestions? Not sure if there's a bapi available for this and i think is not coherent to do a batch input to a transaction like this.
It's my first time using this transaction so any help would be very appreciated.
Thanks for everything.
Luis AllendeI think calling a workbench by RFC does not make much sense.
Have a look into definition of periodic data transfer (there is a small box in step 1 of LSMW).
This allows you to create a frame program which can be executed by a user who does not need to know the whole LSMW.
This program can probably called by RFC
http://help.sap.com/saphelp_nw70/helpdata/en/90/da31ba2e0411d2b43e006094b944c8/frameset.htm -
Calling Form from Another program
All.
I have program A and program B. While executing Program A i need to call a perform (form) from Program B and result out this needs to flow into program A
Like Program B having a form f_select_data
form f_select_data.
select * from mara into table it_mara
where matnr in s_matnr
endform.
I need to call this from program A and results back to A
a®Try this:.
In Z_PROGRAM use function
..PERFORM get_data_from_z_program in Y_PROGRAM.
In Y_PROGRAM write:
FIELD-SYMBOLS: <qals>. (example for qals table)
* inspection lot data
DATA: t_qals LIKE qals OCCURS 0 WITH HEADER LINE.
DATA: wa_qals LIKE LINE OF t_qals.
ASSIGN ('(Z_PROGRAM)QALS[]') TO <qals>.
IF NOT ( <qals> IS INITIAL ) .
t_qals[] = <qals>.
READ TABLE t_qals INTO wa_qals INDEX 1.
IF sy-subrc = 0.
qals = wa_qals.
ENDIF.
ENDIF.
hope helps.. -
Call workflow from ABAP program
created a zbusiness object (ZPRODH)with
one key field product hierarchy,
one attribute level number and
one method display.
I tested that zobject and using this object created workflow to display product hierarchy ,it is displaying it. now I have to call it from one abap program.
In the abap program I am calling the funcion module, I
CALL FUNCTION 'SWW_WI_START_SIMPLE'
EXPORTING
TASK = TASK
IMPORTING
WI_ID = WI_ID
TABLES
AGENTS = AGENTS
WI_CONTAINER = WI_CONTAINER.
It is calling the workflow and subrc is 0, but not passing the value to the workflow. Because of that the method is not working, any idea?
Thanks in advancettpa,
Please check this thread:
Re: Workflow from abap program
Also check that your Fm do requires any explicit commit or not?
Hope it will help u
Cheers
Jai -
The following code will open 'Notepad'
Runtime runt = Runtime.getRuntime();
Process pr = runt.exec( "notepad" );likewise, I want to open 'Wordpad'
Runtime runt = Runtime.getRuntime();
Process pr = runt.exec( "wordpad" );The above two line code, compiles successfully, but it doesn't give the correct result.
If I give 'wordpad' in start->run->'wordpad', in windowXP means, the Runtime executer opens 'WordPad',
can anyone give the solution to open WordPad from Java Programming.
thanks
Sarwan_GresTry this:
Runtime runt = Runtime.getRuntime();
Process pr = runt.exec("cmd /c start wordpad"); -
Calling MB5B from a program to determine stock on hand as on date
Dear friends,
I want to call transaction MB5b from my report passing (matnr, plant and selection date-sy-datum ) values from internal table (11500 records) and fetch the quantity field that gets displayed after executing. How to do that. can anyone write the code for that. Because writing full program for determining stock-on-hand seems meaningless as we can get that value from MB5b. Can we trap that parameter in the standard program RM07mlbd and import that parameter to the program. Any suggestions.
Please write full code. I guarantee Points would be rewarded if solved.
Regards.
D.P.MallickHi,
could you please post the code how it was done. I am facing a similar issue.
Regards
Mohan -
Hi friends,
Can we call a web URL from a ABAP program?
Is there anyway its possible ? if yes how?
Please provide the solution.
Thanks & Regards
kapilHi Kapil,
<b>Look at the below example program:-</b>
REPORT zget_mayors_for_cities.
DATA: it_citymayors TYPE TABLE OF zcitymayors,
wa_citymayors LIKE LINE OF it_citymayors,
mayor TYPE full_name,
trash TYPE string.
PARAMETERS: s_city TYPE s_city LOWER CASE.
SELECT * FROM zcitymayors INTO TABLE it_citymayors
WHERE city LIKE s_city.
* HTTP Client according to
* /people/thomas.jung3/blog/2005/07/01/bsp-create-a-weather-magnet-using-xml-feed-from-weathercom
DATA: client TYPE REF TO if_http_client,
<b>url TYPE string,</b>
xml TYPE xstring,
c_xml TYPE string,
city TYPE string.
* Converter
DATA: l_convin TYPE REF TO cl_abap_conv_in_ce.
LOOP AT it_citymayors INTO wa_citymayors.
* Use the Progress Indicator to show the user which City is processed
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = sy-index
text = wa_citymayors-city.
city = wa_citymayors-city.
* Spaces have to be replaced by _ in the URL
REPLACE FIRST OCCURRENCE OF space IN city WITH '_'.
<b> CONCATENATE
'http://de.wikipedia.org/wiki/Spezial:Export/' city
INTO url.</b>
****Create the HTTP client
TRY.
<b> CALL METHOD cl_http_client=>create_by_url
EXPORTING
url = url
IMPORTING
client = client
EXCEPTIONS
OTHERS = 1.</b>
client->send( ).
client->receive( ).
xml = client->response->get_data( ).
client->close( ).
CATCH cx_root.
WRITE: / 'HTTP Connection error: ', city.
ENDTRY.
* Wikipedia does not provide a encoding with the returned XML
* so we have to do the conversion manually
TRY.
CALL METHOD cl_abap_conv_in_ce=>create
EXPORTING
encoding = 'UTF-8'
input = xml
endian = 'L'
RECEIVING
conv = l_convin.
CALL METHOD l_convin->read
IMPORTING
data = c_xml.
CATCH cx_root.
WRITE: / 'Problem during Character conversion: ', city.
ENDTRY.
****Transform XML to ABAP Values
TRY.
CALL TRANSFORMATION zwikipedia_mayor_to_abap
SOURCE XML c_xml
RESULT mayor = mayor.
CATCH cx_root.
WRITE: / 'Data loss during transformation: ', city.
ENDTRY.
* Some Mayors already have pecial Pages
REPLACE FIRST OCCURRENCE OF '[[' IN mayor WITH ''.
REPLACE FIRST OCCURRENCE OF ']]' IN mayor WITH ''.
* Some Mayors are members of a Party
SPLIT mayor AT '(' INTO mayor trash.
wa_citymayors-mayor = mayor.
WRITE: / wa_citymayors-city.
* Update Database
IF NOT wa_citymayors-mayor IS INITIAL.
UPDATE zcitymayors FROM wa_citymayors.
WRITE: wa_citymayors-mayor.
ENDIF.
ENDLOOP.
Look at the below thread for more info:-
/people/gregor.wolf3/blog/2006/06/29/use-data-from-wikipedia
Regards
Sudheer -
Calling BSP from abap program by interfacing EP
Dear Friends...
I am cslling a BSP... from an ABAP program... for that I have used this class and also a function module to ckeck.. actually from the abap program it invoks the BSP page very nicely and as my logic for invoking the BSP is a part of the Business Object and it is associated with the Enterprise portal so... when i reach the ep and trigger that business object to instantiate the BSP page from my calling logic of abap... it goes to the ITS and port 80 or something and didnt produce the BSP.. and only the blank screen was there...kindly help me how i am supposed to instantiate the BSP from properly from ABAP by interfacing the EP... my code is given below...
data :
lv_url type string.
concatenate
'http://sapdevbp.sbic.co.za:8041/sap(bD1lbiZjPTIwMA==)'
'/bc/bsp/sap/z_updatemng/bp.htm?bpid=' object-key-businesspartnerid
into lv_url.
call method cl_gui_frontend_services=>execute
exporting
document = lv_url
exceptions
others = 1.
please help....
me...
regards
Naimhi ,
you can try using FM CALL_BROWSER in your report(ABAP code)to call bsp,like
data url(200) type c.
url = 'http://<server>.<domain><port>:'.
concatenate url '/sap/bc/bsp/sap/' into url.
concatenate url 'your_bsp_app_name/your_start_page.bsp' into url.
concatenate url '?sap-user=<userid>' into url.
concatenate url '&sap-password=<passowrd>' into url.
CALL FUNCTION 'CALL_BROWSER'
EXPORTING
URL = url
WINDOW_NAME = ' '
NEW_WINDOW = ' '
BROWSER_TYPE =
CONTEXTSTRING =
EXCEPTIONS
FRONTEND_NOT_SUPPORTED = 1
FRONTEND_ERROR = 2
PROG_NOT_FOUND = 3
NO_BATCH = 4
UNSPECIFIED_ERROR = 5
OTHERS = 6
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
For this to work you have to enable SSO on your server.
you can check if it is enabled or not by runnning the BSP application "SYSTEM" ,page "SSO2TEST.htm" .
Follow the instructions on the page for testing.
This may not be a great way as your userid password are passed via URL,still it works
Cheers! -
Call Screen from Standard program
How to Call a screen of a Z Program from an exit in a standard online program...???
Thak's
Flavio RasseliHi.
I create dialog modules via SE35 to Call a screen of a Z Program from an exit in a standard online program.
In the standard:
CALL DIALOG 'ZTEST2'
EXPORTING
act_new FROM 'X'.
But the screen is shown in "full screen".
<b>How to show screen with the definition of the position?</b>
Example:
...STARTING AT 2 2
ENDING AT 60 09.
Thank's
Douglas Sant'Ana -
How to store Connection object and call it from other programs.
Hi,
I am trying to connect to the database, store the connection object and use this connection object from other standalone java programs.
Can any one tell me how to do this? I've tried in the following way:
In the following program I am connecting to the database and saving the connection object in a variable.
public class GetKT2Connection {
public static void main(String[] args) {
String url = "jdbc:odbc:SQLDsn;
String dbUser = "sa";
String dbPwd = "sa";
Connection kt2conn = Connection connection = java.sql.DriverManager.getConnection(url, dbUser, dbPwd);
if(kt2conn == null) {
System.out.println("Database Connection Failure!");
else {
System.out.println("Connected to Database...");
GetKTConnectionObj.storeKT2ConnectionObj(kt2conn);
} Here is the program to save connection object in a variable.
public class GetKTConnectionObj {
static Connection kt2Connection = null;
public static void storeKT2ConnectionObj(Connection conn) {
kt2Connection = conn;
public static Connection getKT2ConnectionObj() {
try {
return kt2Connection;
catch(Exception e){
System.out.println(e);
return null;
}Now from the following code I am trying to get the connection object that is stored. But this is throwing NullPointerException.
public class Metrics_Migration {
public static void main(String args[]) {
try {
java.sql.Connection connection_1 = GetKTConnectionObj.getKT6ConnectionObj();
catch(Exception e){
}kt2Connection is null. You need to store it first, to make it not null. Otherwise it will stay null forever. And why on earth are you trying to do this THIS way?
If you are running the two applications separately, it wont work either. -
Error while calling FM from report program
i am calling a FM using the follwoing program
REPORT ZTEST3.
DATA : EMPNO TYPE zempdata-EMPLOYEE_NUMBER,
EMPNAME TYPE zempdata-EMPLOYEE_NAME,
EMPSAL TYPE zempdata-EMPLOYEE_SALARY.
call function 'ZEMPMASTER'
EXPORTING
EMPNO = '22609'.
EMPNAME = 'vishal'.
EMPSAL = 200.
but when i execute this program i am getting the following error
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_DYN_CALL_PARAM_MISSING', was
not caught and
therefore caused a runtime error.
The reason for the exception is:
When calling the function module "ZEMPMASTER", one of the parameters
needed according to the interface description was not specified.
This parameter was "EMPNAME".
i don't know why i am geteing this error where as in my FM ZEMPMASTER i have given only three input parameters
EMPNO, EMPNAME AND EMPSAL.
my FM code is like as follows
FUNCTION ZEMPMASTER.
""Local Interface:
*" IMPORTING
*" REFERENCE(EMPNO) TYPE ZEMPDATA-EMPLOYEE_NUMBER
*" REFERENCE(EMPNAME) TYPE ZEMPDATA-EMPLOYEE_NAME
*" REFERENCE(EMPSAL) TYPE ZEMPDATA-EMPLOYEE_SALARY
TABLES ZEMPDATA.
BREAK-POINT.
data WA_zempdata type zempdata.
WA_zempdata-EMPLOYEE_NUMBER = EMPNO.
WA_zempdata-EMPLOYEE_NAME = EMPNAME.
WA_zempdata-EMPLOYEE_SALARY = EMPSAL.
BREAK-POINT.
insert into zempdata values wa_zempdata.
WRITE :/ wa_zempdata-employee_number, wa_zempdata-employee_name.
commit work.
ENDFUNCTION.
pls let me know why i am getting this errorHi vishal,
call function 'ZEMPMASTER'
EXPORTING
EMPNO = '22609'.<------- Remove this period
EMPNAME = 'vishal'.<------remove this period
EMPSAL = 200.<-----------*retain this period*
We must never change the format in which a FM is displayed once we call the pattern.
The period will be automatically be available at the end of the FM.need not keep it at end of every line.
Hope this helps.If problem still persists post back.
Regards,
K.Sibi -
Call winhelp from ABAP programs
Hi,
I'm trying to display a windows help file in my ABAP application.
The idea: by pressing the info-button it should display the file "Info.chm".
I can display the file, if it is placed locally on the client machine, but I
want to store it in the system somehow, so that it is available to all of the
users.
How can I place it in some repository, and later call the HtmlHelp Application?
I saw an old example calling
CALL FUNCTION 'WIN_HELP' FROM 'SAP_GUI'
but it doesn't work anymore.
Best regards,
StanimirBrad,
I created the object in the SAP Web repository, transaction SMW0. These are the attributes of the object.
Z_SAP_HELP fileextension .chm
Z_SAP_HELP filename C:\Temp\SAP_help.chm
Z_SAP_HELP filesize 28686
Z_SAP_HELP mimetype chm
Z_SAP_HELP version 00001
I created a new Mine type: chm with extension *.chm
I associated %SystemRoot%\hh.exe as the editor for Mime type chm.
This worked fine for me, but my colleague was unable to successfully run SHOW_WEB_OBJECT until he also set up the editor associated with Mime type chm. Is there a way to systemically set up the association between a mime type and the editor so that each person does not have to go through this process?
Thanks
Bruce
Maybe you are looking for
-
Photo and video consolidation / management
I have photo and video files in multiple locations and applications (desktop, Documents, iPhoto, external hard drive). I'm looking for a program or app that will search, find, and consolidate all my media files (hopefully getting rid of duplicates al
-
Hi Experts, I would Like To set iviews At Various Sizes in my Potal Page. Plz Help Me Out. Thanks.
-
Okay. MacBook for college and I get a free iPod up to $229. Awesome deal, however; would it be possible to get that same deal on a refurbished model? So truly sorry if this is in the wrong category, but my iPod Touch limits my internet browsing. It's
-
Problem installing Visual Studio 2010
Hi, I am trying to install VS2010 on a Windows 7 running on a bootcamp partition of my Mac Book Air. When I insert the DVD on the drive the splash screen shows "Visual Studio 2008 "... It should be 2010. If I continue the installation it stops in the
-
Browse only raw and jpg files, can i do with a script?
Hi I use photoshop cs3 and bridge I would like to know if a script for bridge can let bridge visualize only jpg raw psd files? I know i can do it with filter , but i should setup filter every time i run bridge i would like a scipt that let bridge vis