ABAP動態取得資料

2021-04-12 13:36:05 字數 1349 閱讀 3795

abap

動態查詢的實現:可以完全實現動態查詢,每個欄位都可以動態。

(1)利用巨集

(2)利用abap指標

(3) 利用

field-symbol

具體實現: 1.

結構的動態查詢

define select_data_to_wa.

select &1

from &2

into

corresponding fields of

&3

where (&4).

exit.

endselect.

end-of-definition.

2.變數的動態查詢

define select_data_to_

variant.

select &1

from &2

into &3

where (&4).

exit.

endselect.

end-of-definition. 3.

內錶的動態查詢

define select_data_to_

variant.

select &1

from &2

into

corresponding fields of

table &3

where (&4).

exit.

endselect.

end-of-definition.

具體程式實現:

data: l_field(100) type c,

l_table(10) type c,

l_cond(100) type c.

data: i_cond type talbe of l_cond.

field-symbols type any.

start-of-selection.

concatenate 『carrid』 『connid』 『cityfrom』

into l_s

separate by space.

concatenate 『connid = 『 『』 『0123』 『』』』 into l_cond.

l_table = 『spfli』.

if is assigned.

unassign .

assign spfli to .

else.

assign spfli to .

endif.

select_data_to_wa (l_s) (l_table) i_cond

從Xml中取得資料存在ActiveReports中

asp.net dataset ds new dataset ds.readxml sfilepass sample1 rpt new sample1 rpt.datasource ds.tables 0 defaultview rpt.run webviewer1.report rpt winfo...

C 取得陣列長度

c 中沒有提供 直接獲取陣列長度的函式,對於存放字串的字元陣列提供了乙個strlen函式獲取長度,那麼對於其他型別的陣列如何獲取他們的長度呢?其中一種方法是使 用sizeof array sizeof array 0 在c語言中習慣上在 使用時都把它定義成乙個巨集,比如 define get arr...

sql 語句取得資料表演所有資訊

select 表名 case when a.colorder 1 then d.name else end,欄位序號 a.colorder,欄位名 a.name,字段說明 isnull g.value 標識 case when columnproperty a.id,a.name,isidentit...