‎2009 Jun 10 10:46 AM
Hi Experts I need an advice for the below case.
A flag which is set in the EBAN must be reseted. This
is the programm. It doesn't do that. What can be reason for that.
This is the Function Module Call from SAP SRM System with destination command.
CALL FUNCTION 'ZBM_RESET_FLAG'
DESTINATION 'RV3CLNT888'
EXPORTING
BANFNUMBER = ls_ITEM-EXT_DEMID
EXCEPTIONS
NOT_RESETED = 1
OTHERS = 2.
The Function Module is in the the backendsystem (R/3).
FUNCTION ZBM_RESET_FLAG.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(BANFNUMBER) TYPE BANFN
*" EXCEPTIONS
*" NOT_RESETED
*"----------------------------------------------------------------------
data lt_eban type table of eban.
data ls_eban type eban.
data: l_r_banfn type table of ZBANFEN.
SELECT * FROM eban into table lt_eban where BANFN EQ BANFNUMBER AND LOCKFLAG EQ 'X'.
IF SY-SUBRC IS INITIAL.
LOOP AT lt_eban INTO ls_eban .
clear: ls_eban-LOCKFLAG .
modify eban from ls_eban.
ENDLOOP.
ELSE.
raise NOT_RESETED.
ENDIF.
ENDFUNCTION.
‎2009 Jun 10 10:51 AM
You may check in the backend system by debugging the system .
There can be an issue with the "modify eban from ls_eban."
‎2009 Jun 10 10:51 AM
You may check in the backend system by debugging the system .
There can be an issue with the "modify eban from ls_eban."
‎2009 Jun 10 10:54 AM
Hi,
The field BANFN has a conversion routine associated with it.
Just check whether the Purchase requisition number which you are passing to the FM via the variable
ls_ITEM-EXT_DEMID has padded 0's. If not then use FM CONVERSION_EXIT_ALPHA_INPUT in your RFC FM before the select statement.
Possibly the select statement is failing and hence the update is not happening.
Regards,
Ankur Parab
‎2009 Jun 10 10:55 AM
Hi ertas,
Could you debug and check whether the select is successful.
Whether it is clearing the same entry for that particular record.
Best Regards,
Vanessa Noronha
Edited by: Vanessa Noronha on Jun 10, 2009 11:55 AM
‎2009 Jun 10 11:04 AM
i'm just wondering about that. Do you know how the UPDATE is working?
update eban
set lockflag = ' '
where banfn = banfnumber.
and lockflag = 'X'.
no select, no loop, no modify. Add checking of sy-subrc and sy-dbcnt and give that back to the caller.
Edited by: Rainer Hübenthal on Jun 10, 2009 12:04 PM
‎2009 Jun 10 11:07 AM
looping at lt_eban
Modifying eban ..
Not possible
LOOP AT lt_eban INTO ls_eban . <--------
clear: ls_eban-LOCKFLAG .
modify eban from ls_eban. <-----------
ENDLOOP.
‎2009 Jun 10 11:09 AM
‎2009 Jun 10 11:11 AM
then your rfc connection is not working. But ... i would really change the coding.
‎2009 Jun 10 11:12 AM
how ?
How else can you write this coding ?
Regards
ertas
Edited by: Ilhan Ertas on Jun 10, 2009 12:12 PM
‎2009 Jun 10 11:14 AM
‎2009 Jun 10 11:16 AM
is that the answer ?
looping at lt_eban
Modifying eban ..
This is not a valid abap code
‎2009 Jun 10 11:18 AM
‎2009 Jun 10 11:20 AM
TRANSPORTING addition in MODIFY statement may do the trick for you.
*MODIFY eban FROM ls_eban.
MODIFY eban FROM ls_eban TRANSPORTING lockflag.
‎2009 Jun 10 11:23 AM
if its not working without transporting, it will not work with transporting. But still silly coding.
‎2009 Jun 10 11:27 AM
Hi IIhan,
check the Prv post from Rainer .. Thatz it
and manish "MODIFY eban" is that possible
‎2009 Jun 10 11:28 AM
‎2009 Jun 10 4:04 PM
‎2009 Jun 11 12:15 PM
Dear Colleques,
the problem is still existing.
I have inserted a infinite loop and have called t-code sm50 and debugged this coding.
There is no sy-subrc <> 0 and any error message.
Is it not possible to update a dictionary table via remote call like in my case ?
What is worng here ?
Regards
ertas
data lzahl1 type i .
data lzahl2 type i .
lzahl1 = 0.
lzahl2 = 2.
while lzahl1 < lzahl2.
clear sy-subrc.
endwhile.
data lt_eban type table of eban.
data ls_eban type eban.
data: l_r_banfn type table of ZBANFEN.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = BANFNUMBER
IMPORTING
OUTPUT = BANFNUMBER.
SELECT * FROM eban into table lt_eban where BANFN EQ BANFNUMBER AND LOCKFLAG EQ 'X'.
IF SY-SUBRC IS INITIAL.
LOOP AT lt_eban INTO ls_eban .
UPDATe eban set lockflag = ' ' where banfn = ls_eban-BANFN.
commit work and wait.
ENDLOOP.
ELSE.
raise NOT_RESETED.
ENDIF.
‎2009 Jun 11 12:20 PM
Hi,
what is the type of teh field BANFNUMBER?
Is your select statement returning anything?
Regards,
Ankur Parab
‎2009 Jun 11 12:35 PM
hi parab
the type of the field BANFNUMBER is BANFN
and the select statement is returning 0
Regards
ertas
‎2009 Jun 11 2:19 PM
Hi,
try with this.
LOOP AT lt_eban INTO ls_eban .
UPDATe eban
SET lockflag = space
WHERE banfn = ls_eban-BANFN.
commit work and wait.
ENDLOOP.Regards,
Ankur Parab