2018年6月13日星期三

abap GET VBKEY of CALL FUNCTION IN UPDATE TASK

When we call a function in update task, it stores the data in vbmod, vbhrd and vbdata table.
How to get the vbkey of the current  transaction.

DATA:TH_OPCODE(1)         TYPE X.                "#EC *


CONSTANTSSTART_VB       LIKE TH_OPCODE VALUE 1,"#EC *
           GET_VB_KEY     LIKE TH_OPCODE VALUE 2.


TYPESbegin of %_vbkey,
         head(2),
         vbkey type vbdata-vbkey,
       end of %_vbkey.


DATA:   l_enqkey   type eqeusrvb,
        l_vbkey    type %_vbkey,
        l_enqdone  type length 1.


DATAlt_psguid_ins TYPE TABLE OF psguid WITH HEADER LINE.
DATAls_psguid_ins LIKE psguid.
DATAlt_psguid_upd TYPE TABLE OF psguid WITH HEADER LINE.
DATAls_psguid_upd LIKE psguid.


CALL FUNCTION 'PS_GUID_POST' in update task
       TABLES
            PSGUID_INS lt_psguid_ins
            PSGUID_UPD lt_psguid_upd.



CALL 'ThVBCall'    id 'OPCODE' field get_vb_key

                   id 'VBKEY'   field l_vbkey-vbkey            "#EC *
                   id 'ENQKEY'  field l_enqkey
                   id 'ENQDONE' field l_enqdone.




ThvbCALL will retrieve vbkey value and stored it in variant get_vb_key.
You can use vbkey to get data from vbdata vbmod vbhrd table.











 

没有评论:

发表评论

Customer Characteristic

  Characteristic Descriptions are stored in the table - CABNT - Language - SPRAS - Characteristic description - ATBEZ Characteristic Values ...