2013 Apr 15 7:12 AM
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.
2013 Apr 22 7:23 AM
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.
2013 Apr 22 7:23 AM
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.