开发者

Fetching data from transparent tables

开发者 https://www.devze.com 2022-12-09 04:59 出处:网络
There is a new bapi developed in our sap environment which is fetching data from pool tables and transparent tables.

There is a new bapi developed in our sap environment which is fetching data from pool tables and transparent tables.

When this bapi is called from non sap environment then only pool tables are returning data .Transparent tables are returning blank values.

Case

When we are passing hard coded values 开发者_C百科in "Where Clause" of transparent tables like A931 table ,then transparent tables are also returning data from bapi in non sap environment.

But when we pass values in "Where Clause " of transparent tables through Variables declared in bapi then transparent tables are not returning any value (instead returns Blank) in non SAP environment.


The length of my variable was not of SAP Length required, so I appended zeros.

It worked.


Could you post some ABAP code ? if you declare the tables in your module function, their content should be accessible, and can be returned as table params.

For example in the following code, called by RFC, the table STATES will never be empty, even if you comment the 'select' statement, as two insert statement fill it.

FUNCTION z_prt_dns_status_get.
*"----------------------------------------------------------------------
*"*"Interface locale :
*"  IMPORTING
*"     VALUE(LANGU) TYPE  LANGU DEFAULT 'F'
*"  EXPORTING
*"     VALUE(RETURN) TYPE  BAPIRETURN1
*"  TABLES
*"      STATES STRUCTURE  ZPRT_ATN_STATEST
*"----------------------------------------------------------------------


  SELECT t~atn t~state t~langu t~text s~seqnr
   INTO CORRESPONDING FIELDS OF TABLE states
     FROM zprt_atn_statest AS t
     INNER JOIN zprt_atn_states AS s
        ON s~atn = t~atn AND s~state = t~state
        WHERE t~atn = 'DNS'
        ORDER BY s~seqnr.

  states-text = 'A traiter'.
  states-state = 'OPEN'.
  INSERT states INDEX 1.

  states-text = 'Tous'.
  states-state = '****'.
  INSERT states INDEX 1.

ENDFUNCTION.

regards

0

精彩评论

暂无评论...
验证码 换一张
取 消