data:l_lotno like /JJVC/ERR851-master_lot_num,
l_batno like mchb-charg.
loop at i_inv_data into wa_inv_data.
l_batno = wa_inv_data-charg+0(1).
if l_batno ca SY-ABCDE.
translate l_batno to upper case.
l_lotno = wa_inv_data-charg.
perform f_idoc_851.
perform f_idoc_52 .
perform f_idoc850.
else.
if wa_inv_data-charg na SY-ABCDE
and wa_inv_data-werks eq c_us11.
l_lotno = wa_inv_data-charg+0(6).
perform f_idoc_851.
perform f_idoc_52 .
perform f_idoc850.
endif.
endif.
endloop.
-
data:l_lotno like /JJVC/ERR851-master_lot_num,
l_batno like mchb-charg.
IF p_werks EQ c_us11.
SELECT a~docnum "doc number
b~credat "creation date
b~status "status of idoc
b~statxt "last error message
FROM /jjvc/err851 AS a INNER JOIN edids AS b
ON adocnum = bdocnum
INTO TABLE i_idoc_error
WHERE a~master_lot_num eq l_lotno
AND werks EQ p_werks.
IF sy-subrc <> 0.
ENDIF.
the data in l_lotno and l_batno is not passing from the above if condition to the select statement can any one help me in this.