Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Using logical databases

Former Member
0 Likes
909

Hi

I am trying to pull data from the ADA logical database.  I have a field on the selection screen 'AFABE' and when I enter a value in this field it is filtering the values I get from table ANLB but not from the values I get from ANLAV.

I have attached some snippets of my code.

NODES: ANLAV, ANLZ, ANLB, ANLCV.

START-OF-SELECTION.



GET ANLAV FIELDS BUKRS ANLKL ANLN1 TXT50 INVNR TYPBZ BSTDT URJHR

                 LIFNR SERNR ORD43 ORD42 ORD41 ANLUE KOSTL WERKS

                 ANTEI TXA50 IVDAT INVZU
.



 
MOVE-CORRESPONDING ANLAV TO gs_anlav.

 
APPEND gs_anlav TO gt_anlav.



GET ANLZ.

 
MOVE-CORRESPONDING ANLZ TO gs_anlz.

 
APPEND gs_anlz TO gt_anlz.



GET ANLB FIELDS AFASL AFABG NDJAR.

 
MOVE-CORRESPONDING ANLB TO gs_anlb.

 
APPEND gs_anlb TO gt_anlb.



GET ANLCV .

 
MOVE-CORRESPONDING ANLCV TO gs_anlcv.

 
APPEND gs_anlcv TO gt_anlcv.


END-OF-SELECTION.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
619

I have realised what my problem is.  My understanding of using logical databases is limited so I did not realise how my 4 GET statements interacted.  The GET statements are executed until it does not return a row from the GET statement.

I have changed my code to the following.

GET ANLAV FIELDS BUKRS ANLKL ANLN1 TXT50 INVNR TYPBZ BSTDT URJHR

  LIFNR SERNR ORD43 ORD42 ORD41 ANLUE KOSTL WERKS

  ANTEI TXA50 IVDAT INVZU MENGE.

GET ANLZ.

GET ANLB." FIELDS AFASL AFABG NDJAR.

  MOVE-CORRESPONDING ANLAV TO gs_anlav.

  APPEND gs_anlav TO gt_anlav.

  MOVE-CORRESPONDING ANLZ TO gs_anlz.

  APPEND gs_anlz TO gt_anlz.

  MOVE-CORRESPONDING ANLB TO gs_anlb.

  APPEND gs_anlb TO gt_anlb.

GET ANLCV .

  MOVE-CORRESPONDING ANLCV TO gs_anlcv.

  APPEND gs_anlcv TO gt_anlcv.

So when there is no record returned from ANLB it does not execute data collecting statements and instead loops back to the top.

1 REPLY 1
Read only

Former Member
0 Likes
620

I have realised what my problem is.  My understanding of using logical databases is limited so I did not realise how my 4 GET statements interacted.  The GET statements are executed until it does not return a row from the GET statement.

I have changed my code to the following.

GET ANLAV FIELDS BUKRS ANLKL ANLN1 TXT50 INVNR TYPBZ BSTDT URJHR

  LIFNR SERNR ORD43 ORD42 ORD41 ANLUE KOSTL WERKS

  ANTEI TXA50 IVDAT INVZU MENGE.

GET ANLZ.

GET ANLB." FIELDS AFASL AFABG NDJAR.

  MOVE-CORRESPONDING ANLAV TO gs_anlav.

  APPEND gs_anlav TO gt_anlav.

  MOVE-CORRESPONDING ANLZ TO gs_anlz.

  APPEND gs_anlz TO gt_anlz.

  MOVE-CORRESPONDING ANLB TO gs_anlb.

  APPEND gs_anlb TO gt_anlb.

GET ANLCV .

  MOVE-CORRESPONDING ANLCV TO gs_anlcv.

  APPEND gs_anlcv TO gt_anlcv.

So when there is no record returned from ANLB it does not execute data collecting statements and instead loops back to the top.