Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

reset flag

Former Member
0 Likes
2,307

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.

1 ACCEPTED SOLUTION
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
2,152

You may check in the backend system by debugging the system .

There can be an issue with the "modify eban from ls_eban."

20 REPLIES 20
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
2,153

You may check in the backend system by debugging the system .

There can be an issue with the "modify eban from ls_eban."

Read only

Former Member
0 Likes
2,152

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

Read only

former_member609120
Contributor
0 Likes
2,152

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

Read only

rainer_hbenthal
Active Contributor
0 Likes
2,152

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

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
2,152

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.

Read only

0 Likes
2,152

when I call the Function Module within R/3 then it works

Read only

0 Likes
2,152

then your rfc connection is not working. But ... i would really change the coding.

Read only

0 Likes
2,152

how ?

How else can you write this coding ?

Regards

ertas

Edited by: Ilhan Ertas on Jun 10, 2009 12:12 PM

Read only

0 Likes
2,152

Just read the answers.

Read only

0 Likes
2,152

is that the answer ?

looping at lt_eban

Modifying eban ..

This is not a valid abap code

Read only

0 Likes
2,152

If you cant read i cant help you.

Read only

Former Member
0 Likes
2,152

TRANSPORTING addition in MODIFY statement may do the trick for you.


*MODIFY eban FROM ls_eban.
MODIFY eban FROM ls_eban TRANSPORTING lockflag.

Read only

0 Likes
2,152

if its not working without transporting, it will not work with transporting. But still silly coding.

Read only

0 Likes
2,152

Hi IIhan,

check the Prv post from Rainer .. Thatz it

and manish "MODIFY eban" is that possible

Read only

0 Likes
2,152

Even i think so now..

My apologies..

Read only

Former Member
0 Likes
2,152

hi is there a commit work needed or not ?

Regards

ertas

Read only

Former Member
0 Likes
2,152

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.

Read only

0 Likes
2,152

Hi,

what is the type of teh field BANFNUMBER?

Is your select statement returning anything?

Regards,

Ankur Parab

Read only

0 Likes
2,152

hi parab

the type of the field BANFNUMBER is BANFN

and the select statement is returning 0

Regards

ertas

Read only

0 Likes
2,152

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