hello Deepak,
Chk this link for your solution
i would like to guide that how can any one search hir/Him query in SAP form portal
http://forums.sdn.sap.com/search.jspa?threadID=&q=autonumbering+item&objID=f264&dateRange=lastyear&numResults=30&rankBy=10001
just fill question keyword and search particular function area ..
Thanks
Manvendra
Hi Dipak Patel,
i created BP code by BP Group use FMS . you can refer code.
declare @temp as char(20) IF $[OCRD.GroupCode] =100 BEGIN set @temp=(select isnull(max(right(CardCode,5)),0) + 1 from OCRD where (GroupCode =100) and (len(CardCode)=8)) set @temp='C11'+isnull(replicate(0,5-len(@temp)),'')+@temp select cast(@temp as char(20)) END ELSE IF $[OCRD.GroupCode] = 102 BEGIN set @temp=(select isnull(max(right(CardCode,5)),0) + 1 from OCRD where (GroupCode =102) and (len(CardCode)=8)) set @temp='C12'+isnull(replicate(0,5-len(@temp)),'')+@temp select cast(@temp as char(20)) END ELSE IF $[OCRD.GroupCode] = 103 BEGIN set @temp=(select isnull(max(right(CardCode,5)),0) + 1 from OCRD where (GroupCode =103) and (len(CardCode)=8)) set @temp='C13'+isnull(replicate(0,5-len(@temp)),'')+@temp select cast(@temp as char(20)) END ELSE IF $[OCRD.GroupCode] = 104 BEGIN set @temp=(select isnull(max(right(CardCode,5)),0) + 1 from OCRD where (GroupCode =104) and (len(CardCode)=8)) set @temp='C14'+isnull(replicate(0,5-len(@temp)),'')+@temp select cast(@temp as char(20)) END ELSE IF $[OCRD.GroupCode] = 101 BEGIN set @temp=(select isnull(max(right(CardCode,5)),0) + 1 from OCRD where (GroupCode =101) and (len(CardCode)=8)) set @temp='V11'+isnull(replicate(0,5-len(@temp)),'')+@temp select cast(@temp as char(20)) END ELSE IF $[OCRD.GroupCode] = 105 BEGIN set @temp=(select isnull(max(right(CardCode,5)),0) + 1 from OCRD where (GroupCode =105) and (len(CardCode)=8)) set @temp='V12'+isnull(replicate(0,5-len(@temp)),'')+@temp select cast(@temp as char(20)) END ELSE IF $[OCRD.GroupCode] = 106 BEGIN set @temp=(select isnull(max(right(CardCode,5)),0) + 1 from OCRD where (GroupCode =106) and (len(CardCode)=8)) set @temp='V13'+isnull(replicate(0,5-len(@temp)),'')+@temp select cast(@temp as char(20)) END ELSE IF $[OCRD.GroupCode] = 107 BEGIN set @temp=(select isnull(max(right(CardCode,5)),0) + 1 from OCRD where (GroupCode =107) and (len(CardCode)=8)) set @temp='V14'+isnull(replicate(0,5-len(@temp)),'')+@temp select cast(@temp as char(20)) END ELSE IF $[OCRD.GroupCode] = 108 BEGIN set @temp=(select isnull(max(right(CardCode,5)),0) + 1 from OCRD where (GroupCode =108) and (len(CardCode)=8)) set @temp='V15'+isnull(replicate(0,5-len(@temp)),'')+@temp select cast(@temp as char(20)) END ELSE IF $[OCRD.GroupCode] = 109 BEGIN set @temp=(select isnull(max(right(CardCode,5)),0) + 1 from OCRD where (GroupCode =109) and (len(CardCode)=8)) set @temp='V16'+isnull(replicate(0,5-len(@temp)),'')+@temp select cast(@temp as char(20)) END ELSE IF $[OCRD.GroupCode] = 110 BEGIN set @temp=(select isnull(max(right(CardCode,5)),0) + 1 from OCRD where (GroupCode =110) and (len(CardCode)=8)) set @temp='V17'+isnull(replicate(0,5-len(@temp)),'')+@temp select cast(@temp as char(20)) END
thanks
H2
Add a comment