I am trying to join trip information to the accounting document based on
BKPF-XBLNR = V_PTRV_SREC-REINR OR BSEG_ZUONR = V_PTRV_SREC-REINR
However, the data type for BKPF-XBLNR is CHAR(16), BSEG_ZUONR is CHAR(18), but V_PTRV_SREC-REINR is NUMBER(10). My ABAP join condition returned no records.
How to resolve such problem?
select BUKRS BELNR GJAHR BLART BUDAT into (BKPF-BUKRS,BKPF-BELNR,BKPF-GJAHR,BKPF-BLART,BKPF-BUDAT) from BKPF where (BKPF_clause). select BUKRS BELNR GJAHR ZUONR into (BSEG-BUKRS,BSEG-BELNR,BSEG-GJAHR,BSEG-ZUONR) from BSEG where BUKRS = BKPF-BUKRS and BELNR = BKPF-BELNR and GJAHR = BKPF-GJAHR and (BSEG_clause). select PERNR REINR EXP_TYPE REC_AMOUNT REC_CURR FROM_DATE TO_DATE C_DOC C_TXT into (V_PTRV_SREC-PERNR,V_PTRV_SREC-REINR,V_PTRV_SREC-EXP_TYPE, V_PTRV_SREC-REC_AMOUNT,V_PTRV_SREC-REC_CURR, V_PTRV_SREC-FROM_DATE,V_PTRV_SREC-TO_DATE,V_PTRV_SREC-C_DOC, V_PTRV_SREC-C_TXT) from V_PTRV_SREC where ( ( REINR = BSEG-ZUONR ) ) and (V_PTRV_SREC_clause).