‎2016 Sep 23 10:30 AM
Hi experts,
We have a query where function module BAPI_AR_ACC_GETOPENITEMS is used to get all data like in FBL5N. Now the user needs to simulate FBL5N marking all Type flags: normal items, special g/L transactions, noted items, parked items, vendor items.
Is there any way to call this function with these flags marked or do I have to use any other function ? I've seen fn. BAPI_AR_ACC_GETSTATEMENT but I don't know how to use it.
Thanks in advance !
MarÃa
‎2016 Sep 23 3:14 PM
Dear Maria Merino,
May be you can follow the FBL5N logic like below :
PERFORM fm_check_item_ok USING pa_norm
pa_spec
pa_note
pa_park
gw_bsid
CHANGING lv_okay.
CHECK lv_okay = 'X'. "Check OK
*&---------------------------------------------------------------------*
*& Form fm_CHECK_ITEM_OK
*&---------------------------------------------------------------------*
FORM fm_check_item_ok USING pu_norm
pu_shbv
pu_merk
pu_park
pu_pbil
pu_item LIKE bsid
CHANGING pc_okay.
CLEAR pc_okay.
* normal document:
IF pu_norm = 'X'.
IF ( pu_item-bstat = space ) AND ( pu_item-umskz = space ).
pc_okay = 'X'.
ENDIF.
ENDIF.
* SHB item:
IF pu_shbv = 'X'.
IF ( pu_item-umskz NE space ) AND ( pu_item-bstat NE 'S' ) AND
( pu_item-bstat NE 'V' ) AND ( pu_item-bstat NE 'W' ) AND
( pu_item-bstat NE 'Z' ).
pc_okay = 'X'.
ENDIF.
ENDIF.
* Merkposten:
IF pu_merk = 'X'.
IF pu_item-bstat = 'S'.
pc_okay = 'X'.
ENDIF.
ENDIF.
* parked document:
IF pu_park = 'X'.
IF ( pu_item-bstat = 'V' ) OR ( pu_item-bstat = 'W' ).
pc_okay = 'X'.
ENDIF.
ENDIF.
ENDFORM. " fm_CHECK_ITEM_OK
Regards,
Yance
‎2016 Sep 23 3:25 PM
Hi
The items are returned in the table parameter LINEITEMS, based on the structure BAPI3007_2:
BAPI3007_2-SP_GL_IND -> it's a special G/L item
BAPI3007_2-DOC_STATUS -> it's a noted or parked and etc, etc item
You can use the input parameter NOTEDITEMS in order to select or not to seltec noted items,
Max