Skip to Content
0
Former Member
Apr 01, 2008 at 09:06 AM

Comparing fileds of different type and length

22 Views

Hi abapers,

I ahve an requiremnet to fetch data from table LTAK for the entries fetched from VBFA.the thing is i need to pass VBFA-VBELN to LTAK-TANUM to fetch the records.

Both are of different types and different length .so is it possible to compare these fields.the following is the piece of code for your reference.

SELECT vbelv vbeln vbtyp_n lgnum  FROM vbfa
                                    INTO TABLE i_vbfa
                                    WHERE vbelv   EQ p_del
                                    AND   vbtyp_n EQ 'Q'.
  IF sy-subrc EQ 0.
    SORT i_vbfa BY vbelv.
    DELETE ADJACENT DUPLICATES FROM i_vbfa COMPARING vbelv.

    SELECT lgnum tanum kquit FROM ltak
                             INTO TABLE i_ltak
                             FOR ALL ENTRIES IN i_vbfa
                             WHERE lgnum EQ i_vbfa-lgnum
                             AND      *tanum EQ i_vbfa-vbeln *

So please help me in solving this issue.

Thanks in Advance.

Balaji