How to get First line item in Table control for BDC.
Hi,
I have a requirement while creating the return order from the reference Sales order for BOM.
Once I compare the line items and delete the items not to be returned, I want to read the first line item which in fact is header, to make some changes.
How to read this as cursor points to the last line item.
-B S B
Hi Bsb,
What is exactly unclear to you? =POPO will give a popup screen in which you can enter the order position number. This number will then be on the top of the table which means you can refer to it in BDC with "(01)".
Regards,
John.
Similar Messages
-
How to add new line item using BAPI BAPI_CONTRACT_CHANGE for contract-ME32K
HI Experts,
how to add new line item using BAPI: BAPI_CONTRACT_CHANGE for existing contract.
Requirement:
Already the contract having two line items using ME31K.
Custom program has to add new line items in existing contract.
Thanks,
SendilI got the solution:
We can do like this:
1. Get all details using details, BAPI_CONTRACT_GETDETAIL.
2. After getting results, append new line item. Then use your BAPI.
Check this posting program.. where this bapi is used, use the same coding technique.
IDOC_INPUT_PURCONTRACT_CHANGE -
Hi All,
I have to Get Each line item Create and Approval dates for a SHOPPING CART in SAP SRM. Either a table, or any Function module, Method, please let me know ASAP. Same i can use in my Program.
Thank you Very much.
Regards,
Ramesh J.Hi,
Refer the below wiki link it may help you.
Product catlog configuration for ECC - CRM - SCN Wiki -
WSo2 BDC to delete line item in table control
Hi all,
My requirement is to delete material from wso2 table control.
The only way to delete a line item in this table control is to select the line in table control and delete it.
The recording doesnt captures any selection of row.
Any input on how to caputre particular row ??
Please dont send me links to work with table control in bdc
Regards
BhanuDaveL wrote:
I am not aware of any way to make the BDC delete the row, other than by running in 'A'-all mode and letting the user step through each screen and delete the rows that should be deleted.
Well , if the user has to run it in "A" all screen mode why a BDC is required
DaveL wrote:
Deleting them from the table control would obviously have no effect upon the database table though, would it....it would just hide a row from view in this particular table control
Really ? Well it will delete it from database too i dont know what makes you think that it wont be deleted from database.
Anways i have figured out how to capture row selection in BDC .
Thanks for your reply it proves nothing i guess -
How to modify SO line item VBEP in exit for tcode VA02.
Dear all,
I want to modify the VBEP-MBDAT for a line item in the exit for some condition.
I tried using USEREXIT_SAVE_DOCUMENT and USEREXIT_SAVE_DOCUMENT_PREPARE, but even after changing the VBEP-MBDAT in these two exits, its not getting reflected in the table.
Help me out pls...
regards,
Jinson.Thankyou Andrea,
I tried putting a break point inside USEREXIT_MOVE_FIELD_TO_VBEP.
But it didnt stop there.
Could you please guide me if I need to activate this exit somewhere.
Thanks,
Jinson -
ABAP : How to select a line in a table control
Hi everybody,
I have a multi-item Contract (2 items: item 10 and item 20)
I store the contract items informations in an internal table wt_ha
I want to call a transaction that can assign the quantity of an order item to contract items.
Here's the code :
LOOP AT wt_ha
CONSTANTS :
c_fnam1 TYPE BDCDATA-FNAM VALUE 'CONTRACT_VBAP-SELKZ(',
c_fnam2 type BDCDATA-FNAM value 'CONTRACT_VBAP-POSNR(',
c_close type C VALUE ')'.
wa_sytabix = sy-tabix.
concatenate c_fnam1 wa_sytabix c_close into wa_champ1.
concatenate c_fnam2 wa_sytabix c_close into wa_champ2.
* Transaction VA42
PERFORM bdc_dynpro USING 'SAPMV45A' '0102'.
PERFORM bdc_field USING 'VBAK-VBELN' wt_comm-vbeln.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_dynpro USING 'SAPMV45A' '4001'.
* Action : Assign an item
PERFORM bdc_field USING 'BDC_OKCODE' '=APPL'.
PERFORM bdc_field USING 'BDC_CURSOR' 'VBAP-POSNR(01)'.
PERFORM bdc_field USING 'RV45A-VBAP_SELKZ(01)' 'X'.
PERFORM bdc_dynpro USING 'SAPLV45C' '0103'.
PERFORM bdc_field USING 'BDC_OKCODE' '=ZUOR'.
PERFORM bdc_field USING 'LV45C-VBELN' wt_ha-vbeln.
PERFORM bdc_dynpro USING 'SAPLV45C' '0900'.
PERFORM bdc_field USING 'BDC_CURSOR' wa_champ2.
PERFORM bdc_field USING wa_champ1 'X'.
PERFORM bdc_field USING 'BDC_OKCODE' '=ANWD'.
PERFORM bdc_dynpro USING 'SAPMV45A' '4001'.
PERFORM bdc_field USING 'BDC_OKCODE' '=SICH'.
CALL TRANSACTION 'VA02' USING bdcdata MODE 'N' UPDATE 'S'
MESSAGES INTO wt_mess.
ENDLOOP
The problem is that even if the internal table wt_ha contain 2 items, this programm can assign the order item quantity to only the FIRST contract item !hi there
This is the code to handle BDC table control for sales
order screen, VA02.
PERFORM bdc_dynpro USING 'SAPMV45A' '0102'.
PERFORM bdc_field USING 'BDC_CURSOR'
'VBAK-VBELN'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'VBAK-VBELN'
i_final-sls_docno.
PERFORM bdc_dynpro USING 'SAPMV45A'
'4001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=POPO'.
PERFORM bdc_dynpro USING 'SAPMV45A'
'0251'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV45A-POSNR'.
PERFORM bdc_field USING 'RV45A-POSNR'
i_final-sls_docitm.
PERFORM bdc_field USING 'BDC_OKCODE'
'=POSI'.
PERFORM bdc_dynpro USING 'SAPMV45A'
'4001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=PEIN'.
PERFORM bdc_dynpro USING 'SAPMV45A'
'4003'.
LOOP AT i_vbep WHERE vbeln = v1_docno
AND posnr = v1_docitm..
IF i_vbep-wmeng GT 0.
PERFORM bdc_field USING 'BDC_OKCODE'
'=EIPO'.
PERFORM bdc_dynpro USING 'SAPMV45A'
'0252'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV45A-ETDAT'.
CLEAR w_date.
WRITE i_vbep-edatu TO w_date DD/MM/YYYY.
PERFORM bdc_field USING 'RV45A-ETDAT'
w_date.
IF i_final-kitstatus EQ 'KC'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=POSI'.
PERFORM bdc_dynpro USING 'SAPMV45A'
'4003'.
PERFORM bdc_field USING 'VBEP-LIFSP(01)'
c_blank.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'. "Enter
PERFORM bdc_dynpro USING 'SAPMV45A'
'4003'.
PERFORM bdc_field USING 'VBEP-LIFSP(01)'
c_delblk.
ELSE.
PERFORM bdc_field USING 'BDC_OKCODE'
'=POSI'.
PERFORM bdc_dynpro USING 'SAPMV45A'
'4003'.
PERFORM bdc_field USING 'BDC_CURSOR'
'VBEP-LIFSP(01)'.
PERFORM bdc_field USING 'VBEP-LIFSP(01)'
c_delblk.
ENDIF.
ENDIF.
ENDLOOP.
Save the document
PERFORM bdc_field USING 'BDC_OKCODE' '=SICH'.
CALL TRANSACTION 'VA02' USING i_bdcdata
MODE v_mode
UPDATE 'S'
MESSAGES INTO
i_bdcmessage.
do reward if helpful. -
Dynamically picking the line item of table control
Hi all,
Can u suggest me a way to dynamically picking the no of line item in the table control displayed.
Regards,
Ashutosh KumarHi Ashutosh,
In BDC case, what you can do is use the "position button" instead of finding the number of lines on the table control.
Or else you can use call transaction with 'Options addition'
eg:
Call transaction parameters
clear gs_options.
<b> gs_options-defsize = 'X'. "Default size</b>
gs_options-dismode = 'N'.
gs_options-updmode = 'S'.
call transaction 'VI02' using t_bdcdata
"mode 'N'
"update 'S'
options from gs_options
messages into t_messages.
Please let us know why do you want to know the number of lines on the Table control.If the above answer doesn't satisfy you.
Regards,
Ravi -
How to select perticular row in table control for BDC
Hi all
I want to select perticular row in table control for deletion through BDC. My transaction is CA02, My input is material no and plant , then it display table control with work center. Now i want to select W999 cost center and delete through BDC.
Please Suggest me. it urgent.
Thanks& Regards,
RPHi all
I want to select perticular row in table control for deletion through BDC. My transaction is CA02, My input is material no and plant , then it display table control with work center. Now i want to select W999 cost center and delete through BDC.
Please Suggest me. it urgent.
Thanks& Regards,
RP -
How to get the Number of lines displayed in table control in bdc
Hi,
when we write a bdc for a standard transaction, if we encounter a table control, we fill the values for each record like field(01), and the second record field(02) .......and so on..
if only 3 records are displayed in the screen and if we have 5 records to be filled in the table control, how to write the logic for that?
how to track of how many lines are getting displayed in the table control .. again it depends on the screen resolution i think..
useful answers will be rewarded
shekharHi,
Here is the solution code for this :-
data for controlling paging on screen 0102
DATA: W_MAXLINES(2) TYPE N,
W_NEXT_LINE(3) TYPE N,
W_PAGE(1), "y = page forward, n otherwise
W_SCRLEN(2) TYPE I,
W_SCRLINE(2) TYPE I.
DATA: BEGIN OF W_HDR.
INCLUDE STRUCTURE D020S.
DATA: END OF W_HDR.
DATA: BEGIN OF W_FLD OCCURS 100.
INCLUDE STRUCTURE D021S.
DATA: END OF W_FLD.
DATA: BEGIN OF W_LOG OCCURS 20.
INCLUDE STRUCTURE D022S.
DATA: END OF W_LOG.
DATA: BEGIN OF W_MC OCCURS 20.
INCLUDE STRUCTURE D023S.
DATA: END OF W_MC.
DATA: BEGIN OF W_DYNPRONAME,
PROGRAM(8) VALUE 'SAPMM60X',
DYNPRO(4) VALUE '0102',
END OF W_DYNPRONAME.
FORM GET_MAX_LINES.
set w_maxlines to the number of var-loop occurrences on the screen so
that we know when to page forward on screen 0102
also initialise w_next_line to zero for GET_NEXT_LINE
this subroutine caters for all cases - including screens without loops
CLEAR: W_MAXLINES,
W_NEXT_LINE.
IMPORT DYNPRO W_HDR
W_FLD
W_LOG
W_MC
ID W_DYNPRONAME.
LOOP AT W_FLD WHERE LTYP EQ 'L'.
MOVE W_FLD-LINE TO W_SCRLINE. "first var-loop line
MOVE W_FLD-LBLK TO W_SCRLEN. "depth of loop block
EXIT.
ENDLOOP.
IF SY-SUBRC EQ 0
AND W_SCRLEN NE 0.
sy-srows = total no of lines on screen
w_scrline = actual first line of loop so that
w_scrline - 1 = number of heading lines (before loop)
4 = no of lines at top of screen - command line, pushbuttons, 2 ulines
3 = no of lines after loop - uline & Page count
w_scrlen = no of lines in loop block
w_maxlines = sy-srows - ( wscrline - 1 ) - 4 - 3
and then 1 less but not sure why!
W_MAXLINES = SY-SROWS - W_SCRLINE - 1 - 4 - 3.
W_MAXLINES = W_MAXLINES - 1.
W_MAXLINES = W_MAXLINES DIV W_SCRLEN.
ELSE.
MOVE 99 TO W_MAXLINES. "this required if no screen loop
ENDIF.
ENDFORM.
FORM GET_NEXT_LINE.
set w_page if page forward is required
W_NEXT_LINE = W_NEXT_LINE + 1.
IF W_NEXT_LINE GT W_MAXLINES.
W_NEXT_LINE = 1.
W_PAGE = 'Y'.
ELSE.
W_PAGE = 'N'.
ENDIF.
ENDFORM.
Hope it helps.
reward if helpful.
Regards,
Sipra -
How to set cursor at the first line in a table control?
Hi,
I have a customized infotype screen where a table control is being used to input new values.The tab control has 30 lines.Now, the problem is that when the screen is displayed, the cursor always starts at 8th or 4th line.The behaviour is not very consistent.I tried the following statement in the PBO, but no effect.
SET CURSOR FIELD P9417-ZCOUNTRY LINE 1. ( P9417-ZCOUNTRY is the name of the tab control field where i want to set the cursor ).This is the last statement in the PBO.
Can someone please tell me why still I am not able to set the cursor at the first line? I have infact noticed that , in the debugging mode , sometimes the cursor starts at the first line.Please help. ThanksI have got a new requirement on this now. If the table control does not have any records , then the cursor position should be on the first row.Otherwise, if it already has some records, then the cursor should be at the first empty row.I wrote the code like below.
if sy-ucomm = 'INSERT'.
set cursor 'P9714-ZCOUNTRY' line 1.
else if sy-ucomm eq 'CHANGE'.
describe table itab lines fill.
fill = fill + 1.
set cursor 'P9714-ZCOUNTRY' line fill.
endif.
I am facing a strange problem now.The table control has some 10 rows when you see the screen for the first time.If the number of records already present is less than 10, I am able to position the cursor on the first empty row.But if the number is say 15, then the cursor position goes to eighth or fourth line or sometimes the first line.
Is there any way to display the last few records , ie, if there are 15 records , is there any way to display the last five rows when I see the screen for the first time, rather than showing the first 10 records?How can I position the cursor at the first empty row, when there are more records?
Thanks in advance..good answers will be rewarded.
Mahesh -
How to pick the value of the line item in table control
My screen.
I have designed table control by referring internal table without using wizard.
I have placed button inside of that table control.
my requirement is by clicking the button it ll show the value of the line inside of the table control.
I have used "get cursor...".
But the problem is "it ll show only the cursor value of the front screen, if suppose i scroll the value of table control at the time also, it ll show the cursor value of the screen, it ll not show the exact value of the cursor inside of the table control.Wrong Forum Anand......!
-
How to get 3 line items of service tax into 1 line item?
Hi All,
I have a requirement in Service Tax calculation. As of now when an user post any Vendor invoice in Service tax it is posting 3 line items, i.e. Service tax, Edu cess and Higher Edu cess. But user want to post all 3 line item should come as 1 line item. Even I tried for changing GL Accounts in OB40 then it is posting to same GL account but 3 different line items. Can any give their inputs.
Thanks
VallabhHello,
tell the user if you make three line items into one then you will be running from pillar to post segregating the Basic Tax, Edu Cess & H Edu Cess at the time of monthly reporting to statutory authorities. Pls ask the user to show you the service tax reporting format, you will understand.
Pls explain user the advantage of having three separate line items so that user is able to appreciate working in SAP.
Otherwise, in OBQ3 (Tax Procedure) you can remove the settings of condition types for ECess & HEcess and also delete the tax % maintained in FV11. The service tax will work only with one condition types where you maintain the entire 12.36% which according to me is little incorrect. Pls take a call accordingly
best regds
Subha -
Copy of a line item in table control
Save Our Environment. Save Yourself.
Hi All,
Firstly, I have an invoice number on one screen 0050. When I enter one invoice number and ENTER, it'll take me to screen 0100 in which there is a table control having some 10 columns. This will be a display of the line items of that particular invoice number.
Now, in these columns 2 will be editable and all the rest non-editable. Now, based on some condition, when the user tries to save these entries after inputting some values into those editable fields, I need to make a copy of the same line (means with all same values).
Can somebody please tell me whether this is possible? I tried searching in SCN, but was not clear with some solutions.
Thanks a lot.
- I'm not an environmentalist. I'm an Earth warrior.HI,
You can use GET CURSOR LINE LINE_NO this will give you the sy-index so that you can read the itab like
read table itab index line_no. This is one option and second is if you have row selector.
read table itab with key mark = 'X'.
If you want the Row contents befor the PAI triggers
[Check this Thread|Table Control dynamic F4;
Hope this is clear to you.
Regards
Ram -
How to get current row data in table control
Hi , expert ,
I am professional in oracle , but now I am a new guy in SAP ABAP .
I have a question in UI
How to get current row data and click pushbutton in table control to open next screen ?
I want to get the current data and open next screen to carry out detail detail .
Thansk for all your suggestion .GET CURSOR LINE SY-CUROW .
READ TABLE internal_table index SY-CUROW. -
How to determine line number on Table control in BDC
Hi,
I am uploading changes for CG02 using BDC. I have to change data to specification type which are listed in a table control having some of the fields as IDCAT, IDTYPE, LANG, ORD, IDENT etc.
For a particular substance number, there can be variable number of idtypes. Since there were 8 Idtypes already created for the substance number I was working with while recording and I created 9th Idtyep(Z_SARADOT#) while recording (Using SHBD), I am getting the code like ...'ESTRI-IDTYPE(09)....ESTRI-IDCAT(09).....'RCGRIIOT-IDENT(09)' which indicate that while recording, the values were added on 9th line of table control.
Now this line number can vary for other substance number. How can I know
(1) The last line of table control
(2) Line number based on Value of field
Example - here I want to know line number corresponding to IDTYPE Z_SARADOT# if it was created so that I can change the value of field IDENT of the table control.
The piece of code I got after recording is:
perform bdc_field using 'ESTRI-IDTYPE(09)'
'NUM'.
perform bdc_field using 'ESTRI-IDCAT(09)'
'Z_SARADOT#'.
perform bdc_field using 'RCGRIIOT-IDENT(09)'
'1175'.
Please help friends.
Thanks & Regards,
SuryaThere are around 800 Substance numbers and for each substance number there are around 10 IDtype. So It would be a costly processing.
If there no other way doing it?
I think, I need to follow this way as We can not determine the line number untill BDC is running.
Maybe you are looking for
-
Worst Ever Experience with Blackberry
I am a Gr8 fan of blackberry , Specially The BB10 OS. Few years back i was using Blackberry curve the basic model & used it for around a year and a half. I faced lots of issue regarding battery & its backup , Device Heating . Last year i switched to
-
Hi I have a question about banks, I hope I am in the correct forum. 1. From a review of house banks set at my company I have noted one with no GL code assigned to it. What would be the impact of this, could payments still be made from this account??
-
Problem with RFC Function module
Hello All, I have created one RFC with importing parameters as material and material description.when I pass some value in material desc it always convert into the uppercase.I have one option of checkbox for upper/lower case but i have to do it manua
-
Respect original media creation date in final cut server ?
my question is... is there any way for final cut server to respect the original finder creation date of the media? I do understand that the file is being newly created in the database and thus will have a creation and modification date of when you pu
-
FCE un synching vid/aud between Viewer and Canvas 3 secs out in 20 sec clip
OK I'm new to FCE having moved across from Vegas Video. Working through the Izzy FCE Tutorial. Starts with a 20 second HD clip that works great in the Viewer. Drag video to time line and it looks OK except the audio is waaaaay out of wack. In a 20 se