Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Help in FM

Former Member
0 Kudos

Hi i have created FM name

ybapi_ycats_display,

remote one,

import para are

1. counter type catscounter

2. pernr type pernr_d

3. workdate type catsworkdate

Export para

1. Return type Bapireturn

source code -


> I want for retrieving data from table Catsdb and display and convert into XML

thank you.

Points will be rewarded

Jagrut Bharatkumar Shukla

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Fetch the data using query from CATSDB table, store it into internal table and

use SAP_CONVERT_TO_XML_FORMAT FM to convert it.

Reward if useful!

3 REPLIES 3

Former Member
0 Kudos

Hi,

Fetch the data using query from CATSDB table, store it into internal table and

use SAP_CONVERT_TO_XML_FORMAT FM to convert it.

Reward if useful!

Former Member
0 Kudos

Hi,

Just look at this piece of code, I think it should help you.

DATA : ITAB TYPE TABLE OF SPFLI,

L_XML TYPE REF TO CL_XML_DOCUMENT.

SELECT * FROM SPFLI INTO TABLE ITAB.

  • CREATE THE XML OBJECT

CREATE OBJECT L_XML.

  • CONVERT THE DATA TO XML

CALL METHOD L_XML->CREATE_WITH_DATA( DATAOBJECT = ITAB[] ).

  • DATA IS CONVERTED TO XML; DISPLAY THE XML-DOCUMENT

CALL METHOD L_XML->DISPLAY.

Regards

Sudheer

Former Member
0 Kudos

Hi,

Fetch your data into an internal table and use the CALL TRANSFORMATION to convert your internal table into an XML File.

CALL TRANSFORMATION {trans|(name)}

[PARAMETERS {p1 = e1 p2 = e2 ...}|(ptab)]

[OBJECTS {o1 = e1 o2 = e2 ...}|(otab)]

[transformation_options]

SOURCE {XML sxml}

| {{bn1 = e1 bn2 = e2 ...}|(stab)}

RESULT {XML rxml}

| {{bn1 = f1 bn2 = f2 ...}|(rtab)}.

Regards,

Shruthi R