instance 1
CONTEXTS demo_travel.
TYPES fields TYPE context_t_demo_travel.
DATA: carrier TYPE fields-carrid,
connection TYPE fields-connid,
c_from TYPE fields-cityfrom,
c_to TYPE fields-cityto,
c_time TYPE fields-fltime.DATA: demo_travel_inst1 TYPE context_demo_travel,
demo_travel_inst2 TYPE context_demo_travel.carrier = 'LH'.
connection = '400'.SUPPLY carrid = carrier
connid = connection
TO CONTEXT demo_travel_inst1.carrier = 'AA'.
connection = '017'.SUPPLY carrid = carrier
connid = connection
TO CONTEXT demo_travel_inst2.DEMAND cityfrom = c_from
cityto = c_to
fltime = c_time
FROM CONTEXT demo_travel_inst1.WRITE: / c_from, c_to, c_time.
DEMAND cityfrom = c_from
cityto = c_to
fltime = c_time
FROM CONTEXT demo_travel_inst2.WRITE: / c_from, c_to, c_time.
instance 2
DATA: percentage TYPE i.
CONTEXTS docu_test4.
DATA: context_inst TYPE context_docu_test4.
DATA itab TYPE TABLE OF symsg WITH HEADER LINE.
SUPPLY max = 00
occ = 20
TO CONTEXT context_inst.DEMAND percent = percentage
FROM CONTEXT context_inst MESSAGES INTO itab.WRITE: / 'Percentage: ', percentage. "#EC NOTEXT
IF sy-subrc NE 0.
LOOP AT itab.
WRITE: / itab-msgty, / itab-msgid, / itab-msgno,
/ itab-msgv1, / itab-msgv2.
ENDLOOP.
ENDIF.
Context对象
原创wx638ee25dac6f7 博主文章分类:01 ABAP 基础 ©著作权
©著作权归作者所有:来自51CTO博客作者wx638ee25dac6f7的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
承前启后,Java对象内存布局和对象头JVM Java
-
Context, What Context?
请点击查看原文Context可能是Android应用程序中最常用的元素…同时也最容易被误用.型 Contex
android ide UI 生命周期 -
android应用里有几种context对象
避免内存泄露,任何时候都要警惕。-----箴言-----内容简介:Android Context,用于描述当前App,或者Activiy,Service等组件的上下文信息。在Android系统中,通过Context可以进行很多操作,例如访问加载和访问资源。在通过Context(确切的说,是当前的Activity,Service,App)进行操作的时候,需要注意,作为一个
Context Android Context Android内存泄露 内存泄露 Android leak