How to capture an Odata XML inside an ABAP program ?
Hi Colleagues,
I have a scenario where I need to capture the Odata XML inside an ABAP program.
Problem Description:
1. Log into U3F Client 100 system.
2. Goto Transaction 'SPRO'.
3. Click on 'SAP Reference IMG'.
4. Select SAP Netweaver - Gateway - OData channel - Administration - Maintain Services.
5. Select any service from the Service catalog.
6. Click on 'Call Browser' button.
Now, my requirement is to capture the XML which gets displayed on the web browser into an ABAP program but I am unable to do so. Kindly, provide us the solution.
Best Regards,
Naresh
Hi,
Check this example
[http://help.sap.com/saphelp_nwpi71/helpdata/en/1f/93163f9959a808e10000000a114084/content.htm|http://help.sap.com/saphelp_nwpi71/helpdata/en/1f/93163f9959a808e10000000a114084/content.htm]
Regards,
Ivan
Similar Messages
-
If you login to an SAP session and then create another session via the system menu option (not a second login), transaction SM04 will show two different values for the parameter:
modeinfo[n].context_id_uuid
I need to know how to retrieve the value of this parameter from inside an ABAP program.
This question is related to the one Rich and Naren and I were discussing - about how to create a unique shared buffer memory id that will distinugish between a two sesssions of a single user who happens to be "MIGO'ng" twice.
Thanks for whatever answer anyone can provide ...
djh
Note: also posted in ABAP General ...Rich answered in ABAP general:
REPORT ZRICH_0001 .
type-pools: thfb.
data: context_id type THFB_CONTEXT_ID.
CALL FUNCTION 'TH_GET_CONTEXT_ID'
IMPORTING
CONTEXT_ID = context_id .
write:/ context_id . -
How To Call a Broadcasting Template within an ABAP program
I was wondering if anyone knew how to call the Broadcast template via an ABAP program so it will execute? The scenario that I have is we are doing validations via BW. We put the data (for conversion reasons) through validation rules and then load a data target. From this, there are 2 situations that could occur:
1) There are errors
2) There are not any errors
If #1 is true, then I would like to execute the Query Broadcasting Template that I have created. If #2 is true, then I would like to execute another process via the ABAP program. In the past, I was successful using exception reporting via reporting agent, since I was able to call that program but the report did not look good at all. Please let me know if there is a program that I could call in order to execute this broadcast that I have set up.
Best Regards,
TimHello,
although this is an old threat, but do you have any hints on how to dynamically change the template when broadcasting?
kind regards
Murat -
How to call a BW Query from an ABAP program?
How to call a BW Query from an ABAP program?
hi
check this link
/people/durairaj.athavanraja/blog/2005/04/03/execute-bw-query-using-abap-part-i
/people/durairaj.athavanraja/blog/2005/04/03/execute-bw-query-using-abap-part-ii
/people/durairaj.athavanraja/blog/2005/12/05/execute-bw-query-using-abap-part-iii
hope this helps
cheers -
How to find the start condition of a ABAP program?
Hello Gurus!,
Could any one please explain how to find the start condition of a ABAP program?
like its a event based or time based?and also how to find that event and time..
Thanks in Advance...
DinakarHi Dinkar,
Go to Job Schedule, put Job Step parameter as your program and see scheduled Job.
In Schedule Job double click to see start condition. and steps to see details and variant.
Hope it helps.
Thanks
CK -
Urgent!! How to call a custom transaction or an ABAP program in BSP?
Urgent!! How to call a custom transaction or an ABAP program in BSP?
We are pretty new on BSP. Would be very appreciated if any expert here give us the detailed steps on how to build up the application to just call a custom transaction (e.g., t-code: ztest) or an ABAP program. Would we have to create a button or event handler to do that? And the detailed steps?
Thanks in advance and we will definately give you reward points!hi Durairaj,
During the time to wait for your answer, we copied Bernd's code from your last link, but when activating it, get the 1st error msg:
Field "CLIENT" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. "DATA" statement."DATA" statement. The error shows up here:
<td>
<htmlb:inputField id = "client"
value = "<%= client %>" />
</td>
Then we added Client to the page attribute and define it as type String, then get another error:
The field "EVENT" is unknown, but there is a field with the similar name "EVENT_ID"."EVENT_ID". This error shows up at the beginning in the Event Handler:
OnInputProcessing:
code
event handler for checking and processing user input and
for defining navigation
event handler for data retrieval
event = cl_htmlb_manager=>get_event( runtime->server->request ).
IF event->name = 'button' AND event->event_type = 'click'.
button_event ?= event.
How to resolve this unknown Event error, need to define in Page Attribute tab? but with what type?
Actually we only want to run an ABAP4 program in BSP, the code is complicated, could you show us an easy way of doing this in BSP? -
How can i get access code to create ABAP Program ?
hi guys ,
How can i get access code for creating ABAP Program in my System.
I am using SAP IDES 4.6 Version
Please Help me out .
Regards
RaghuHi Raghu,
- license your system (http://service.sap.com/licensekey)
- create a developer key (http://service.sap.com/sscr)
- create a key for your ABAP program (httP://service.sap.com/sscr)
Markus -
How to execute an SQL query present in a string inside an ABAP program?
hello,
How to execute an SQL query present in a string inside an ABAP programRaut,
You can execute Native SQl statements.
Ex: To use a Native SQL statement, you must precede it with the EXEC SQL statement, and follow it with the ENDEXEC statement as follows:
EXEC SQL [PERFORMING <form>].
<Native SQL statement>
ENDEXEC.
There is no period after Native SQL statements. Furthermore, using inverted commas (") or an asterisk (*) at the beginning of a line in a native SQL statement does not introduce a comment as it would in normal ABAP syntax. You need to know whether table and field names are case-sensitive in your chosen database.
In Native SQL statements, the data is transported between the database table and the ABAP program using host variables. These are declared in the ABAP program, and preceded in the Native SQL statement by a colon (:). You can use elementary structures as host variables. Exceptionally, structures in an INTO clause are treated as though all of their fields were listed individually.
If the selection in a Native SQL SELECT statement is a table, you can pass it to ABAP line by line using the PERFORMING addition. The program calls a subroutine <form> for each line read. You can process the data further within the subroutine.
As in Open SQL, after the ENDEXEC statement, SY-DBCNT contains the number of lines processed. In nearly all cases, SY-SUBRC contains the value 0 after the ENDEXEC statement. Cursor operations form an exception: After FETCH, SY-SUBRC is 4 if no more records could be read. This also applies when you read a result set using EXEC SQL PERFORMING.
EXEC SQL PERFORMING loop_output.
SELECT connid, cityfrom, cityto
INTO :wa
FROM spfli
WHERE carrid = :c1
ENDEXEC.
Pls. Mark If useful -
Reading XML Data from ABAP Program?
Hi,
How do I read XML Data from an ABAP Program? For example if I have the below basic XML Code-
<xml>
<Name> Thiru </Name>
<Age> 24 </Age>
<City> chennai </Chennai>
</xml>
How do i read the data within the Name,Age, and City tags into variables in the ABAP Program?
Regards,
Thiruif you decide to do in XSLT, I have a sample list here:
XML file like this:
<?xml version="1.0" encoding="UTF-16"?>
<F>
<P1>
<t_1>value1</t_1>
<t_2>testvalue</t_2>
</P1>
<P2>
</P2>
</F>
XSLT file like this:
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sapxsl="http://www.sap.com/sapxsl" version="1.0">
<xsl:strip-space elements="*"/>
<xsl:template match="F">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<<b>DOCUMENT</b>>
<xsl:apply-templates/>
</<b>DOCUMENT</b>>
</asx:values>
</asx:abap>
</xsl:template>
<xsl:template match="P1">
<ENTRY>
<<b>T_1</b>><xsl:value-of select="t_1"/></T_1>
<<b>T_2</b>><xsl:value-of select="t_2"/></T_2>
</ENTRY>
</xsl:template>
</xsl:transform>
ABAP program like this:
DATA: BEGIN OF wa_upload,
text(255) TYPE c,
END OF wa_upload,
itab_upload LIKE TABLE OF wa_upload,
BEGIN OF wa_document,
t_1 TYPE string,
t_2 TYPE string,
END OF wa_document,
itab_document LIKE TABLE OF wa_document.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'XXXXX'
filetype = 'ASC'
TABLES
data_tab = itab_upload.
CALL TRANSFORMATION zrappel_xml_test
SOURCE XML itab_upload
RESULT <b>document</b> = itab_document.
You should pay attention to the bold words.
hope it will be helpful
thanks -
Hi everyone!
Is there a way in ABAP to output XML files? Pls. send code/ function module if any.
From ABAP programs, we are sure that we can output TEXT files, but how about XML files?
The significance of this question is related
Currently we are using XI to interface SAP and AMS, this question for ABAP to produce XML file arose, if for example, the XI server is down and we have to still send data from one system to another. IDocs can also produce XML files, pls confirm. Earlier however, we have preferred XI rather than IDocs to do this. Anyway, any idea regarding this scenario will be greatly appreciated.
Thanks and God bless!
CelesteHi,
Please check this sample codes from other thread.
1. itab --- > xml
xml ---> itab.
2. This program will do both.
(just copy paste in new program)
3.
REPORT abc.
*-------------- DATA
DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
DATA : BEGIN OF itab OCCURS 0,
a(100) TYPE c,
END OF itab.
DATA: xml_out TYPE string .
DATA : BEGIN OF upl OCCURS 0,
f(255) TYPE c,
END OF upl.
DATA: xmlupl TYPE string .
******************************* FIRST PHASE
******************************* FIRST PHASE
******************************* FIRST PHASE
*------------------ Fetch Data
SELECT * FROM t001 INTO TABLE t001.
*------------------- XML
CALL TRANSFORMATION ('ID')
SOURCE tab = t001[]
RESULT XML xml_out.
CALL FUNCTION 'SCMS_STRING_TO_FTEXT'
EXPORTING
TEXT = xml_out
* IMPORTING
* LENGTH =
TABLES
FTEXT_TAB = itab.
*-------------- Download
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filetype = 'BIN'
filename = 'd:xx.xml'
TABLES
data_tab = itab.
******************************* SECOND PHASE
******************************* SECOND PHASE
******************************* SECOND PHASE
BREAK-POINT.
REFRESH t001.
CLEAR t001.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'D:XX.XML'
filetype = 'BIN'
TABLES
data_tab = upl.
LOOP AT upl.
CONCATENATE xmlupl upl-f INTO xmlupl.
ENDLOOP.
*------------------- XML
CALL TRANSFORMATION ('ID')
SOURCE XML xmlupl
RESULT tab = t001[]
BREAK-POINT.
Regards,
Ferry Lianto -
How use a proxy consumer web service in ABAP Program with local interface
I generate a proxy class based on a WSDL file.
I want to use this class in an abap programm without a connection but using XML files in local.
I see with the class CL_PROXY_LOCAL_ADAPTER that it is possible to execute without connection but for use this, it's necessary to use the method REGISTER.
This method have two parameters : Class Name and Interface Name.
Class name is the name of my proxy class, but I don't know how to find the interface name.
I think that a local interface is needed to generate but I don't know how to generate in interface with entries in SPROXSIG table ?
Could you help me ?Check out the following links to see if it meets your needs.. Has examples to call a ABAP proxy (that consumes a webservice) from ABAP program...
http://help.sap.com/saphelp_nw04/helpdata/en/bf/d005244e9d1d4d92b2fe7935556b4c/frameset.htm (webservices ->webservices toolset -> examples)
http://help.sap.com/saphelp_dm40/helpdata/en/1a/b69d427cab0831e10000000a1550b0/frameset.htm -
How can i print data in smartforms from ABAP program.
Dear gurus:
in my abap program i process require data, and saved in a internal table.
how can l print the data in smartforms.?
who can give me a code sample is better:)
reward all helpful advise.Try this....
1) Tcode --> SmartForms
2) Form name --> Z_SF_TEST Create
3) Under Global settings
a) Form Interface
Table Tab
ITAB LIKE EKPO
b) GLOBAL Definitions
WA_NETPR LIKE EKPO-NETPR
In smart forms if we want to display quantity and currency fields. We can't directly display currency field and quantity fields
For that we have to create an extra variable in global definitions
Ex: netpr FIELD of EKPO
CREATE program lines and specify WA_NETWR = itab-netpr.
4) RT CLick on main Window
CREATE --> TABLE
Click Table painter
DEFAULT %LTYPE will be Created
a) If you want more like Header footer etc add by rt click on %LTYPE1
Table (Tab)
%LTYPE Radio(SELECT) 5 CM 5 CM 6 CM
CLICK on DATA (Tab)
INTERNAL TABLE ITAB LIKE ITAB
5)RT click on table control and create --> program lines
General attribute (Tab)
INPUT PARAMETER OUTPUT PARAMETER
itab WA_NETPR
Code Area
WA_NETWR = ITAB-NETPR.
6) RT CLcick on table ctl and create 3 text to display the fields
a) % text1 +button(insert field)
FIELD name &itab-ebeln&
Output options (tab)
Check New line LINETYPE %Ltype1
check new cell
b) % text2
& itab-ebelp&
output options
check new cell
c) % text2
& wa_netpr&
output options
check new cell
<b>Report ac
Tables ekpo.
Data: itab1 like ekpo occurs 0 with header line.
select * into table itab1 from ekpo.
Call function module --> smart form function module and pass your internal table</b>
Regards,
SaiRam -
How can I trigger an event from an ABAP Program
Hi everyone,
I have a requirement, where I have to create an ABAP program, that has to execute (trigger) an event which belongs to a Process Chain. when I run the program, the Process Chain has to run.
So, how can I do it?
Thanks for your help, FedericoHI ,
The program can call function module BP_EVENT_RAISE to raise the event. you can create vent in sm64 and sm62 .There you give the parameter of the event same as what you will define in the event of start variant of your process chian ..
Regards,
shikha -
How to create relationship to call PO13 in ABAP program.
Hi,
Could anybody help me how to create relationship (like PO13) in abap program. Do we have any Function modules or any other way?
Regards,
Ram.Hi,
You can use function module RH_INSERT_INFTY. There are plenty of threads of the forum on how to use it.
Donnie -
How to crate a spool number for the abap program
hi
how to create a spool number for the abap programHi,
Check this thread
how to create a spool requset for 'z program'.
Regards,
Satish
Maybe you are looking for
-
Is it the hard drive? and battery? What's up with my specs? 3 threads?
My battery had not been fully recharging for a while. For weeks, it would "max out" at a lower percentage, lowering incrementally pretty much weekly. No, I am not eligible for the recall. One fitful night, I came home to a shut down computer. When it
-
RMAN-target database not found
Hello All: we have rman config (0 level bkp) for our PROD backup, rman catalog is on a different server. running OK. heaving 0 level backup of our PROD.... no issue. Now we have one more PROD db implemented recently for payroll on seperate server, so
-
Configurable Networks in Assembly Processing
Hi Gurus, I have implemented Assembly Processing with configurable networks. I am facing an issue here. The requirment is to capture the Delivery time ( Z field) from quotation and apply a formula and calculate the normal duration of the activites o
-
How do I mark someone as important while using "do not disturb"?
How do I specify a person as important when I choose to have "do not disturb" on?
-
Lecture / Ecriture simultannée
Bonjour, Pour une application, il me faut générer un signal sinusoidale qui est envoyé dans un procédé de commande et je dois lire la sortie de ce procédé, jai réaliser mes VI FPGA et RT qui me semble bon mais je ne saisi pas si il est judicieux de l