SELECT bukrs
belnr
gjahr
buzei
INTO TABLE it_bseg
FROM bseg
FOR ALL ENTRIES IN it_bkpf
WHERE bukrs = it_bkpf-bukrs
AND belnr = it_bkpf-belnr
AND gjahr = it_bkpf-gjahr .
DATA: et_bseg1 TYPE TABLE OF bseg.
DATA: et_par1 TYPE fagl_t_field.
APPEND 'BUKRS' TO et_par1 .
APPEND 'BELNR' TO et_par1 .
APPEND 'GJAHR' TO et_par1 .
APPEND 'BUZEI' TO et_par1 .
CALL FUNCTION 'FAGL_GET_BSEG_FOR_ALL_ENTRIES'
EXPORTING
it_for_all_entries = it_bkpf[]
i_where_clause = | BUKRS = IT_FOR_ALL_ENTRIES- BUKRS AND BELNR = IT_FOR_ALL_ENTRIES-BELNR AND GJAHR = IT_FOR_ALL_ENTRIES-GJAHR|
it_fieldlist = et_par1
IMPORTING
et_bseg = et_bseg1
EXCEPTIONS
NOT FOUND = 1
OTHERS = 2.
IF sy-subrc = 0 .
sy-dbcnt = lines( et_cmo_bseg1 ).
IF sy-subrc = 0 AND lines( et_bseg1 ) > 0 .
MOVE-CORRESPONDING et_bseg1 TO it_bseg[] .
ELSE.
sy-subrc = 4.
ENDIF.
ENDIF.
SELECT SINGLE wbstk
FROM vbuk
INTO l_delivery_gi_status
WHERE vbeln = <lfs_xvttp>-vbeln.
SELECT SINGLE wbstk
FROM likp
INTO l_delivery_gi_status
WHERE vbeln = <lfs_xvttp>-vbeln.
SELECT SINGLE wbstk trsta INTO (l_wbstk, l_trsta)
FROM vbuk
WHERE vbeln = p_v_delivery AND
vbtyp = 'J'.
DATA: lwa_cmo_VBUK_temp1 TYPE vbuk.
CALL FUNCTION 'SD_VBUK_READ_FROM_DOC'
EXPORTING
i_vbeln = P_V_DELIVERY
i_vbtyp = 'J'
IMPORTING
es_vbuk = lwa_VBUK_temp1
EXCEPTIONS
vbeln_not_found = 1
vbtyp_not_supported = 2
OTHERS = 4.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
MOVE lwa_vbuk_temp1-wbstk TO l_wbstk .
MOVE lwa_vbuk_temp1-trsta TO l_trsta .
SELECT SINGLE tab FROM t881
INTO v_tabela
WHERE rldnr EQ '90'.
cl_fins_acdoc_util=>get_t881_emu(
EXPORTING
iv_rldnr = '90' " Ledger
IMPORTING
es_t881 = DATA(EWA_finsdoc2) " Ledger Master
EXCEPTIONS
not_found = 1
OTHERS = 2 ).
IF sy-subrc = 0.
v_tabela = ewa_finsdoc2-tab .
ENDIF.
SELECT knumv kschl kbetr
FROM konv
INTO TABLE t_konv
FOR ALL ENTRIES IN t_vbak
WHERE knumv = t_vbak-knumv.
DATA: BEGIN OF ET_cmo_KONV1 OCCURS 0 ,
knumv TYPE knumv,
kschl TYPE kscha,
kbetr TYPE kbetr,
END OF ET_KONV1 .
SELECT knumv, kschl, kbetr
FROM v_konv_cds
INTO TABLE @et_konv1
FOR ALL ENTRIES IN @t_vbak
WHERE knumv = @t_vbak-knumv.
MOVE-CORRESPONDING ET_KONV1[] TO t_konv[] .
SELECT * FROM vbrk
INTO TABLE it_vbrk
WHERE fkart = 'F2'.
SELECT * FROM vbrk
INTO TABLE it_vbrk
WHERE fkart = 'F2'.
AND draft = space.
BSEG | Replace SELECT by API |
VBUK | · If Status fields to be selected up from VBUK, use respective document tables like VBAP and LIKP · If multiple fields from VBUK to be selected use the API |
VBUP | If multiple fields from VBUK to be selected use the API |
T881, T881T and T881G | Use API instead of direct SELECT on Tables T881, T881T and T881G |
KONV | Use the CDS view V_KONV instead of KONV or SAP std API |
VBRK and VBRP | Use additional condition DRAFT = space in Where clause of SELECT |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
4 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 |