08-08-2007 11:25 PM
Hi Experts,
I hv a issue. pls. clarify.
The BDC_SESSION_program is performing VA 42 i.e. Change Contract transaction. My requirement path is,
VA 42 ---> specify my_contract ---> Search -
Consider Subseuqzúent docs
-> Menu->Extras>Technical Objects->Now, SAP displays Table control - of 13 Lines per screen..........but, actually, my_contarct has 100 lines(records).
So, here at this point I wanna to change the Serial # i.e. SERNR field from X_SERNR to Y_SERNR in the above said table control.........but this X_SERNR is located as (say) 90 th line/record of displayed table control(which is displaying only 13 lines per page/per screen, actually, i red, the # of records/lines is depends on screen resolution, but any how 90 # is high) i.e. 2/3/4 th page down/scroll downing on table control.
So, How to find out the location / line # / record #, of my X_SERNR on the dispalyed table control and there by need to change it to Y_SERNR?
thanq.
Message was edited by:
Srikhar
08-08-2007 11:44 PM
I saw transaction,table control is scrollable,so no need to setup screen resolution.
You can use simple logic :
you need to concatenate the fields and index ,and do the bdc recording properly.
data g_ctr(3) type n.
LOOP AT t_tcdata.
g_ctr = g_ctr + 01.
CONCATENATE c_matnr '( ' g_ctr ' ) ' INTO g_mabnr.
PERFORM f_bdc_field USING g_mabnr t_tcdata-matnr.
CONCATENATE c_kdmat '( ' g_ctr ' ) ' INTO g_kdmat.
PERFORM f_bdc_field USING g_kdmat t_tcdata-kdmat.
CONCATENATE c_kwmeng '( ' g_ctr ' ) ' INTO g_kwmeng.
PERFORM f_bdc_field USING g_kwmeng t_tcdata-kwmeng.
CONCATENATE c_charg '( ' g_ctr ' ) ' INTO g_charg.
PERFORM f_bdc_field USING g_charg t_tcdata-charg.
ENDLOOP.
Thanks
Seshu
08-08-2007 11:44 PM
I saw transaction,table control is scrollable,so no need to setup screen resolution.
You can use simple logic :
you need to concatenate the fields and index ,and do the bdc recording properly.
data g_ctr(3) type n.
LOOP AT t_tcdata.
g_ctr = g_ctr + 01.
CONCATENATE c_matnr '( ' g_ctr ' ) ' INTO g_mabnr.
PERFORM f_bdc_field USING g_mabnr t_tcdata-matnr.
CONCATENATE c_kdmat '( ' g_ctr ' ) ' INTO g_kdmat.
PERFORM f_bdc_field USING g_kdmat t_tcdata-kdmat.
CONCATENATE c_kwmeng '( ' g_ctr ' ) ' INTO g_kwmeng.
PERFORM f_bdc_field USING g_kwmeng t_tcdata-kwmeng.
CONCATENATE c_charg '( ' g_ctr ' ) ' INTO g_charg.
PERFORM f_bdc_field USING g_charg t_tcdata-charg.
ENDLOOP.
Thanks
Seshu
08-08-2007 11:53 PM
08-09-2007 12:27 AM
08-09-2007 12:46 AM
Hi Srikhar,
I think you first need to get yourself familarize with the Table control BDC.
Just check below link
http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
Now in table control lets say you want to go to the 20th record and only first 16 are visible on screen, then you need to enter page down '=P+' then based on the transaction the 20th field become 4th or 5th. As in some transaction 17th become 1 and in some 16th value become 1.
Hope I am clear in explaining this.
Regards,
Atish
08-09-2007 12:57 AM
thanq.
sorry, may b i did not presenting my issue!
ur statement : <i>you want to go to the 20th record</i>
I dont know, What is the line # of my X_SERNR is located in the displayed table control( of say, 16 lines) i.e. Where is my X_SERNR is located, may b 90 th line!
1 case - if X_SERNR is located as (say, <16) 5th line, programe is changing from X_SERNR to Y_SERNR, fine.
2 - case - if X_SERNR is located as 90 line i.e. 2/3/4 th page of table control ! here, prog. is not working! first, I need to pick the the X_SERNR line # and then I need to change it to Y_SERNR.
So, my issue is that, How to find out the line # of my X_SERNR in the displayed table control?
thanq.
08-09-2007 1:04 AM
Hi Srikhar,
Let me explain you, In table control lets say there are 16 line displayed and the record you required is 90th record (I said record not line).
Now in table control there will always be only 16 LINES(in our assumption we assumed 16 lines). So If you want to go to the 90th record then you have to go to Page 6 and 10th Line.
Hope this is clear.
Regards,
Atish
08-09-2007 1:27 AM
thanq.
ok, let me explain in this way,
I waanna to change contract (/sales order). I mean, I wanna to find out the X_SERNR and then wanna change it to Y_SERNR.
So, I went to VA 42 transaction, followed above said path, after getting the SAP given table control, I searched for my X_SERNR, I did not find on first table control screen, so, I did page down / scroll down, (say)again I did not find, again page down, there I found and I changed from X_SERNR to Y_SERNR.
So, now, In BDC SESSION, How to find/trace out the X_SERNR for changing it to Y_SERNR?( I think, it looks like, hard coding numbers is creates issues, bcoz, we dont know, the resolution of screen of the user's machine, which decides the records # in table control! sorry, if am wrong)
pls. clarify, thanq.
Message was edited by:
Srikhar
08-09-2007 1:29 AM
Hi Srikhar,
I have one question ? do you want insert new record with respect to table control,or update existing record ?
if you want to update existing record then it may not be possible since VA42 Transaction table control does not have find button or position button.
always you can insert the record,if you want to update then this is highly difficult.
you may have to look for other alternative.
I guess FM BAPI_SALESORDER_CHANGE or BAPI_CUSTOMERCONTRACT_CHANGE(This should work) will work for VA42..
if you want to insert new records then you need to use my first reply logic.
Thanks
Seshu
08-09-2007 1:35 AM
thanq,
certainly, I wanna to update i.e. X_SERNR to Y_SERNR. ur right, my lead also said the same that, VA42 does not hv the FIND button! makes us to take challenge! I dont think, lead would say OK for BAPI?
My idea is that,
Pushing NEW LINE button>entering 999 under SORT field> entering X_SERNR under SERNR field->pushing SORT button>pushing VERY LAST PAGE button of menu>????? from here, I am confusing How to get it done/update? any idea?
thanq.
Message was edited by:
Srikhar
08-09-2007 2:11 AM
It will be difficult logic you need to write when you use BDC..
here you do not have any find button.
Each page it will have 13 records ,depend upon sernr field you need to update.
first you need to use sort button(here will be the problem,how to justify what is sernr field),based on req you need to page down.
I have doubt on BDC... since we will not have any control here..
Otherway try with FM : IWOU_POST_SER02
I see always your posting challenging developments,it is very intersting
Thanks
Seshu
08-09-2007 3:41 AM
Sorry guys for mis-presenting my issue.
just now, I talked to BA and realised that I mis-understood.
Requirement is: in one word,(contimuation of the posting),
We know, X_SERNR (value) and Y_SERNR(value) of SERNR field.
Delete X_SERNR possesing record from displayed Table control.
Add Y_SERNR as NEW LINE to the same table control.
like, there r multiples(looping).
So, now, hope I can get some idea!to find out X_SERNR record, I add 999 to SORT field in BDCDATA table, populates/passess to screen, PUSH SORT, push DELETE LINE, next ADD NEW LINE.....!
Ideas r appreciated.
thanq.
Message was edited by:
Srikhar
08-09-2007 3:42 AM
Sorry guys for mis-presenting my issue.
just now, I talked to BA and realised that I mis-understood.
Requirement is: in one word,(contimuation of the posting),
We know, X_SERNR (value) and Y_SERNR(value) of SERNR field.
Delete X_SERNR possesing record from displayed Table control.
Add Y_SERNR as NEW LINE to the same table control.
like, there r multiples(looping).
So, now, hope I can get some idea! to find out X_SERNR record, I add 999 to SORT field in BDCDATA table, populates/passess to screen, PUSH SORT, push DELETE LINE, next ADD NEW LINE.....!
UR Ideas r appreciated.
thanq.
Message was edited by:
Srikhar
08-09-2007 12:36 PM
hi,
looks like, difficult to achieve the requirement with BDC. but i hv seen the BAPI s, mentioned by u, like contarct change, sales order change, iowa_ser02 , but i did not find the sernr parameter! once agin i will search for the sernr parameter, anyhow, am opening a new thread.
thaq.
08-09-2007 2:33 PM
Yes Srikhar, I told you earlier if you use BDC , writing the logic will be very difficult.
I have never worked on VA42 Transaction,because of your thread i opened VA42 Transaction.
GOTO SE37 -> search like SERNR -> and see what are the FM's available.
Thanks
Seshu