×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

在 SAP ABAP 里面 Join: BSEG-ZUONR 和 V_PTRV_SREC-REINR, 可是数据类型不匹配

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).
Report

Replies, comments and Discussions:

  • 工作学习 / 学科技术讨论 / 在 SAP ABAP 里面 Join: BSEG-ZUONR 和 V_PTRV_SREC-REINR, 可是数据类型不匹配

    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).
    
    • How to convert CHAR field to NUMC type, so that I can join them in ABAP?
      Any SAP guru here to help?
    • 没有人知道吗?