We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

RE:[sap-dev] Dynamic column name in dynamic SQL statement

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Posted by Alex_H
on Jun 21 at 2:47 AM
Mark this reply as helpfulMark as helpful
Hello together!

Thank you Ingrid and Ben for your answers.

Seems that Ittoolbox cut my code! :-S Another try...

FUNCTION Z_FUMO_XX02.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(TABLE_NAME) TYPE ZSTRUCTURE_TABLE_NAME
*" VALUE(COLUMN_NAME) TYPE ZSTRUCTURE_COLUMN_NAME
*" EXPORTING
*" VALUE(COUNTED_ROWS) TYPE ZSTRUCTURE_MAX_VALUE
*"----------------------------------------------------------------------

SELECT MAX( COLUMN_NAME ) FROM (TABLE_NAME) INTO SQL_DATA.

ENDFUNCTION.

---------------Original Message---------------
From: Alex_H
Sent: Wednesday, June 16, 2010 10:41 AM
Subject: Dynamic column name in dynamic SQL statement

> Hey Guys,
>
> I want to extract various data from our SAP system. Therefore I use little function module which include SQL statements. Most of them work very well (e.g. select column x from table y), but when I tried to create a dynamic SQL statement, I got an error message.
>
> Following code so far:
>
> FUNCTION Z_FUMO_XX02.
>
> *" IMPORTING
> *" VALUE(TABLE_NAME) TYPE ZSTRUCTURE_TABLE_NAME
> *" VALUE(COLUMN_NAME) TYPE ZSTRUCTURE_COLUMN_NAME
> *" TABLES
> *" SQL_DATA TYPE Z_TABLE_SQL_DATE OPTIONAL
> *"

__.____._
Copyright © 2010 Toolbox.com and message author.

Toolbox.com 4343 N. Scottsdale Road Suite 280, Scottsdale, AZ 85251
In the Spotlight
Earn Recognition for Your Contributions at Toolbox for IT. Gain Points for Community Achievements
_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language