"SELECT SINGLE" is not working.
Hi all,
here i have one report. And in this i want just one row when my input material number match with my table material number this time if movement type is 131 then program will be terminated otherwise it's working but this coding is not working properly so can you please help me out.
My code is below .
data : matnr1 LIKE mseg-matnr,
bwart1 LIKE mseg-bwart.
loop at mseg.
SELECT SINGLE matnr bwart from mseg into (matnr1,bwart1) where matnr = matnr.
endloop.
if bwart1 = '131'.
MESSAGE 'DATA NOT FOUND FOR THIS SELECTION1' type 'I'.
SUBMIT ZPP_DAYWISE_MY_OWN VIA SELECTION-SCREEN AND RETURN .
LEAVE PROGRAM.
endif.
CLEAR matnr1.
CLEAR bwart1.
there should be all key fields in where condition of SELECT SINGLE
here in select which matnr you are passing? selection screen of mseg-matnr?
loop at mseg.
SELECTmatnr bwart from mseg upto 1 rows into (matnr1,bwart1) where matnr = matnr. endselect.
endloop.
if bwart1 = '131'.
MESSAGE 'DATA NOT FOUND FOR THIS SELECTION1' type 'I'.
SUBMIT ZPP_DAYWISE_MY_OWN VIA SELECTION-SCREEN AND RETURN .
LEAVE PROGRAM.
CLEAR matnr1.
CLEAR bwart1.
endif.
Edited by: Sachin Bidkar on Feb 23, 2010 7:12 AM
Similar Messages
-
Multi-select LOV does not work in forms
the multi select LOV does not work in the form.
the LOV works individually but in the form it does not work. it does not allow multiple selection from the list.
is there a workaround for this or is this a bug ...?
any ideas ...?
thanx a lot.
nullRight, we cannot store more than one value in a single column in a table :), we were getting a lot of requests to support multiple select LOVs but requirements were contradictory if not mutually exclusive.
The only sense it makes is when used together with user-defined object types (nested tables for example) but the current [application building]infrastructure we have does not support this. However, we are looking into this and this feature maybe implemented in a future release. -
Select() function is not working properly in solaris 10.
Hi ,
We are facing an issue with select() in Solaris 10. we had written a sample program to this issue.
Program name :- sel.cpp
int main()
struct timeval sleeptime;
sleeptime.tv_sec = 60;
printf("1\n");
select(0,NULL,NULL,NULL,&sleeptime);
printf("2");
return 0;
When i run this program in Solaris 9, its printing 1 and after one minute its printing 2.
When i run this program on Solaris 10, its printing 1 and 2 without waiting for 60 seconds.
When i tried to print tv_usec, its printing as 0 in solaris 9 and some garbage values in solaris 10.
I think because of that the above select function is not working properly in solaris 10.
Why the tv_usec is not taking 0 as default values in Solaris 10?
We are using our legacy code for past 20 years. So, before going to do any changes we are trying to find why this happenig like this.
Thanks a lot.
Regards,
Srikanth.haisrig wrote:
Hi ,
We are facing an issue with select() in Solaris 10. we had written a sample program to this issue.
Program name :- sel.cpp
int main()
struct timeval sleeptime;
sleeptime.tv_sec = 60;
printf("1\n");
select(0,NULL,NULL,NULL,&sleeptime);
printf("2");
return 0;
When i run this program in Solaris 9, its printing 1 and after one minute its printing 2.
When i run this program on Solaris 10, its printing 1 and 2 without waiting for 60 seconds.
When i tried to print tv_usec, its printing as 0 in solaris 9 and some garbage values in solaris 10.
I think because of that the above select function is not working properly in solaris 10.
Why the tv_usec is not taking 0 as default values in Solaris 10?
We are using our legacy code for past 20 years. So, before going to do any changes we are trying to find why this happenig like this.Hi
It sounds to me that you've been lucky for 20 years then.
Local POD variables on the stack that aren't explicitly initialized can contain any value. Here's what I see in your app with dbx
(dbx) run
Running: sel
stopped in main at line 9 in file "sel.cpp"
9 sleeptime.tv_sec = 60;
(dbx) print sleeptime
sleeptime = {
tv_sec = -4198732
tv_usec = 0
}That's on a Solaris 10 SPARC machine. If I try it on a Solaris 10 x86 box then I get
(dbx) print sleeptime
sleeptime = {
tv_sec = -830490588
tv_usec = 134510556
and I see the behaviour that you describe.
Paul -
Select query is not working in BDC Program
Hi,
I am working in BDC for update valuation class for T-code mm01.Actually In this BDC i am using two recoding based on material type.
i am using two internal table : I_DATA and ITAB
Use I_DATA to hold excle data in which material No, plant , valuation type , valuation No. and ITAB for material No, material type Only.
So, i am fetching material Type ( MARA-MTART ) through select query. But Select query is not working. and also i did check MARA table according that Material Number then material no. exit in Mara Table.
Note : at run time I_DATA have 1 row but ITAB have 0 row ....
DATA: BEGIN OF I_DATA OCCURS 0,
MATNR TYPE MARA-MATNR,
WERKS TYPE MARC-WERKS,
BWTAR TYPE RMMG1-BWTAR,
VERPR TYPE BMMH1-VERPR,
BKLAS TYPE MBEW-BKLAS,
STATUS TYPE C,
END OF I_DATA.
DATA : BEGIN OF ITAB OCCURS 0,
MATNR LIKE MARA-MATNR,
MTART LIKE MARA-MTART,
END OF ITAB.
Loop at I_DATA.
select matnr mtart from mara into table itab where matnr = I_DATA-matnr.
endloop.
Guide me..........If you use your
Loop at I_DATA.
select matnr mtart from mara into table itab
where matnr = I_DATA-matnr.
endloop.
At end of loop, itab will only contain the result of the last select, so use a
Loop at I_DATA.
select matnr mtart from mara APPENDING table itab
where matnr = I_DATA-matnr.
endloop.
better
if I_DATA[] is not initial.
select matnr mtart from mara into table itab
FOR ALL ENTRIES IN i_data where matnr = i_data-matnr.
endif.
Some Remarks
- If actually required (where does I_DATA come from, is it an external format, you need the internal value to use in SELECT statement), check via SE11 the correct [conversion exit|http://help.sap.com/saphelp_nw04/helpdata/en/35/26b217afab52b9e10000009b38f974/content.htm] associated with domain MATNR (Is it truly ALPHA, and not something like MATN1, so [CONVERSION_EXIT_MATN1_INPUT|http://www.sdn.sap.com/irj/scn/advancedsearch?query=conversion_exit_matn1_input])
- You could try to use BAPI like [BAPI_MATERIAL_SAVEDATA|http://www.sdn.sap.com/irj/scn/advancedsearch?query=bapi_material_savedata] and not BDC
Regards,
Raymond -
Extension in Select-Options is not working
Hi,
The extension of select-options is not working for the following statement........
SELECTION-SCREEN: BEGIN OF BLOCK sel WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_tp_no FOR e070-trkorr.
SELECTION-SCREEN: END OF BLOCK sel.
Please Help.......
Thanks,
SheelSELECTION-SCREEN: BEGIN OF BLOCK sel WITH FRAME TITLE text-001.
SELECTION-SCREEN: END OF BLOCK sel.
Remove the colan ':' from ur code after SELECTION-SCREEN
write it as
SELECTION-SCREEN BEGIN OF BLOCK sel WITH FRAME TITLE text-001.
SELECTION-SCREEN END OF BLOCK sel. -
My 2gb nano's select button will suddenly not work. The rest of the clickwheel and buttons work find, but not the center select button.
I restored it to original settings. Then after it restarts, you have to select a language. The select button would still not work, but then I slid the "hold" button back and forth and the select button worked to allow me to chose a language. But at the next screen of options (Music/Photos/Extras, etc.) the select button will again not work. Sliding the hold button back and forth doesn't work. I cannot do a menu+select reset because I can't get the select button to respond.
I have made sure that I have the most updated softward for the nano.
Any suggestions?My select button has not worked for a loong time.. It will occasionally work if I press for long enough or hard enough.. but not very often. This seems to be a common enough problem so there should be a way to fix it..I hope..
-
Why select query is not working?
CREATE OR REPLACE TYPE prod_type AS OBJECT (
pid INT,
pprice NUMBER,
MEMBER PROCEDURE display(pid IN NUMBER));
create table prod of prod_type (pid primary key);
CREATE OR REPLACE TYPE deal_type UNDER prod_type (
ctr NUMBER,
OVERRIDING MEMBER PROCEDURE display (pid IN NUMBER),
insert into prod values(deal_type(101, 4, 1));
insert into prod values(deal_type(102, 5, 0));
------below given select query is NOT WORKING ---------
select ctr from prod p where p.pid=101;
Thanks,
-Nid------below given select query is NOT WORKINGWondering how you inserted data ...
SQL> CREATE OR REPLACE TYPE prod_type AS OBJECT (
2 pid INT,
3 pprice NUMBER,
4 MEMBER PROCEDURE display(pid IN NUMBER));
5 /
Type created.
SQL>
SQL> create table prod of prod_type (pid primary key);
Table created.
SQL>
SQL> CREATE OR REPLACE TYPE deal_type UNDER prod_type (
2 ctr NUMBER,
3 OVERRIDING MEMBER PROCEDURE display (pid IN NUMBER),
4 );
5 /
Warning: Type created with compilation errors.
SQL> sho err
Errors for TYPE DEAL_TYPE:
LINE/COL ERROR
4/1 PLS-00103: Encountered the symbol ")" when expecting one of the
following:
, not pragma <an identifier>
<a double-quoted delimited-identifier> final instantiable
current order overriding static member constructor map
SQL> CREATE OR REPLACE TYPE deal_type UNDER prod_type (
2 ctr NUMBER,
3 OVERRIDING MEMBER PROCEDURE display (pid IN NUMBER));
4 /
Warning: Type created with compilation errors.
SQL> sho err
Errors for TYPE DEAL_TYPE:
LINE/COL ERROR
1/1 PLS-00590: attempting to create a subtype UNDER a FINAL type
SQL>You made an attempt to create a subtype UNDER a FINAL type - that the reason why can not work ...
Avoid deriving a subtype from this FINAL type.
HTH -
Select list pagination not working for big tables
Hi,
i am trying to view a table with large amount of data using tabular form. the pagination using select list is not working in this page. i have selected select list kind of pagination but it is showing "row range 1-15 16-30(with set pagination)' type of pagination. when i lowered the amount of data in the table the pagination type will automatically change to select list pagination. could you please tell me why this happens and any possible work around if any.
Thanks,
JoHi Jo,
I don't know what you call a large amount of records, but the effect you describe might be intentional by apex.
The select list pagination would generate a selection tag with (number of records in table/15) options in your page HTML.
Although there isn't a hard limit to the number of options a select list can have there certainly is a limit to what your browser/pc can render.
Think about it
Let's say you table contains a million rows. this would result to a select list with 66666 options. Which your browser won't handle :)
I very possible the apex team resolved this by simply reverting to row range pagination when the number of select options would grow to large.
Geert -
SELECT DISTINCT does not work - Another Problem!
Dear All
Previous Post
I just posted a thread, which has been answered by an expert. It's here:
SELECT DISTINCT does not work. Why?
My original problem was that the Query returned duplicate records, and SELECT DISTINCT did not work.
The solution was to change this select:
T0.[U_SupInv] AS 'Link'
... to this:
CAST(T0.[U_SupInv] as nvarchar(100)) AS 'Link'
The amended Query worked.
New Problem
I just discovered that resolving the problem created a new one.
The field U_SupInv (Link) is in fact a UDF.
I created it so that all Suppliers' Invoices could be Scanned to pdf files, and these pdf could be linked
to the respective AP Invoice.
Originally, when I clicked 'Link' in my Query results, the pdf scan pops up.
When the Query is amended by adding CAST, the link becomes dead.
Help
Could anyone tell me how I can make SELECT DISTINCT work, as well keeping the LINKS live?
The main purpose of my Query is to help users view the pdf scans by clicking on the links.
Thanks
Leon Lai
Here's my Original Query
SELECT
T0.[UpdateDate] AS 'Update Dt',
T0.[TaxDate] AS 'Doc Dt',
CASE T5.[TransType]
WHEN '18' THEN 'PU ' + CONVERT(VARCHAR(6), T0.[DocNum])
WHEN '19' THEN 'PC ' + CONVERT(VARCHAR(6), T0.[DocNum])
END 'SAP Ref.',
T1.[ImportLog] AS 'Ship #',
T0.[CardCode] + '' AS 'Supplier #',
T0.[CardName] AS 'Supplier Name',
T0.[DocTotal] AS 'Rs',
T1.[BlockNum] AS 'Reqn #',
T0.[DocNum] AS 'Doc No',
T0.[U_SupInv] AS 'Link'
FROM klship.[dbo].[OPCH] T0
INNER JOIN klship.[dbo].[PCH1] T1 ON T0.[DocEntry] = T1.[DocEntry]
INNER JOIN klship.[dbo].[OJDT] T5 ON T0.[TransID] = T5.[TransID]
WHERE
(T0.[UpdateDate] >= '[%2]' AND
T0.[UpdateDate] <= '[%3]' AND
T0.[U_SupInv] IS NULL)
OR
(T0.[UpdateDate] >= '[%4]' AND
T0.[UpdateDate] <= '[%5]' AND
T0.[U_SupInv] IS NOT NULL)
FOR BROWSEDear István Korös,
Thanks a lot for your answer.
I will test your suggestion tomorrow, as it's night and I am returning home now.
However, I do not think it will suit my requirements for the foll reasons:
- I worked hard to get rid of the need to enter anything in the @Scan2 field.
- This UDF was created solely as a text of instruction for my staff.
Unfortunately I had to fill in something to make the Query work.
- The problem is that if the user forgets to click the drop-down arrow and leaves @Scan2
blank, the query does not work.
- With the help of another expert, I succeeded in ignoring @Scan2 altogether.
- I posted only a simplified version of my Query on the forum, without the codes relating to eliminating the
need to enter something in @Scan2, so you may not be aware of my requirement.
- I hope you understand my reluctance. But I will try your suggestion nevertheless.
My Suggestion
I think using PCH1.VISORDER may be the solution.
If we select only those rows where visorder = 0, then
- there will be no duplication
- I need not use SELECT DISTINCT
- All my LINKS to pdf files will be live because I need not use CAST
- I may retain that part of my Query which permits ignoring @Scan2 altogether.
- A Dream!-
The problem is that I don't know how and where to place that VISORDER.
If you think I may be right, could you help me along that line?
Best Regards
Leon Lai -
Double click select all does not work in web site's search area after going back.
After updating from Firefox ESR v24.8.1 to v31.20 double click select all does not work in a search area after going back or searching again with the same input. It happens before clicking search icon and searching for something else double click select all does not work except it works for one word that's all.
This issue is with all new Firefox ESR and None ESR I have tried. Also the issue is on all web sites like www.softpedia.com for example.Bugzilla has a different login system, unfortunately.
-
"Select Color Range" not working. "Warning: No pixels were selected" returned when attempting to use. Using Photoshop CS6 on a Mac running OS X Yosemite
Here are three screenshots in succession from trying to perform the color selection:
Dropbox - Screenshot 2015-02-12 14.57.40.png
Dropbox - Screenshot 2015-02-12 15.00.14(2).png
Dropbox - Screenshot 2015-02-12 15.01.00.png -
Zen Micro 5gb - Playlist on the fly with "add to selected" often does not work (AD HOC 'playlis
I've found ad-hoc playlist made from ADD TO SELECTED often does not work. Here are other issues:?. Does not add? at all OR only adds after first song selected played2. Cannot swith from ARTISTS to SONGS w/o killing list. This will kill the ongoing list.3. If I make mistake and hit the PLAY button, it wipes out the entire list I'd already made. Any of these issues resolved in Zen Vision M?
try reloading the firmware and if that doesnt work try opening the case and cleaning it if there is anything in there. the button may be stuck. and if that doesnt work i dont know what else to sugjest. it seemed to work for me.
-
LOV single selection list is not working in my JDeveloper 10.1.2.3
Hi!
I'm stumped with this. I'm also new to JDeveloper. I used the sample tutorial from the OTN website entitled "JSPDataBoundLists.jws" to learn how to create drop-down lists in JDeveloper.
My problem is I created a single selection list LOV from DepartmentListView Data Control and pasted it into an EmployeesView Input form. This is so I can just select the Department names to populate the DepartmentID field in Employees table. I setup the data binding in the UI Model of my jsp using the "List Binding Editor". I checked the UIModel file and it looks as follows:
<DCControl
id="DepartmentId2"
SubType="DCListSingleSel"
IterBinding="EmployeesViewIterator"
DTClass="oracle.adf.dt.objects.JUDTCtrlListLOV"
ApplyValidation="false"
isDynamic="false"
ListOperMode="0"
ListIter="DepartmentsListViewIterator" >
<AttrNames>
<Item Value="DepartmentId" />
</AttrNames>
<ListAttrNames>
<Item Value="DepartmentId" />
</ListAttrNames>
<ListDisplayAttrNames>
<Item Value="DepartmentName" />
</ListDisplayAttrNames>
</DCControl>
I run the jsp, selected a value from the drop-down list, do a submit and do a commit, but the DepartmentId from the DepartmentsListView was not stored in Employees. What is wierd here is that there is an exact same single selection list defined a row above mine which is working fine. How come that one is working and mine is not?Eureka! I finally found the answer to my own question!
This simple problem of adding a drop-down list into a jsp page cost me 3 whole days (around 24 full working hours) to find the answer. Normally it only takes me a few minutes with the other web app languages I've learned. And I just stumbled into the answer just a few minutes ago (maybe all thanks should be given to God whom let me stumble into the answer since me and my wife have been praying for several weeks now ever since I started trying to learn Oracle JDeveloper. It is really very very difficult and time consuming to learn compared to other web app languages and tools).
Anyway, the reason why my LOV does not work in my jsps using JDeveloper 10.1.2.3 is because JDeveloper 10.1.2.3 seems to allow only one input-form-element for the same field of the input table!
For example, what happened to me was I had an input form created for the Employees table in the HR schema. I did this simply by drag-and-drop from the "Data Control Palette". This feature I like very much with JDeveloper. It is really easy and works instantly. And then, I drag-and-drop the departmentname field from the Departments table as a "single selection list" into the jsp and setup its bindings. So when I run the jsp, viola! The drop-down list does not populate the DepartmentId field of the Employees table. IT DOES NOT WORK! I've tried reinstalling both JDev and Oracle db and JDKs to no avail! I tried posting in this forum to no avail! I tried experimenting with newly created jsps to no avail! Then suddenly after repeatedly experimenting on this on different tutorials, guides and my own web app, it works! Why did it work? It was because I tried to add an LOV-single-selection-list on another sample tutorial with a READ-ONLY FORM on the jsp! Thus only the LOV is the input-form-element in the jsp for the table's field.
So why can't you find such a simple and basic fact anywhere in the web, the tutorials, guides or the forum? I do not know. Maybe only I am using such an old version of JDev? But what about the users who used it when it just got out a couple of years ago? Didn't they have the same problem? Anyway, it seems like the answer to a lot of my simple basic questions about JDeveloper is not documented, or is buried very deep beneath all the other words of all these documents. Hopefully JDeveloper's documentations would get a lot easier to use very very soon! -
SELECT statement does not work if characters ## are contained in field
Hi Experts,
I have the following statement:
select single field1
from table1
into var1
where field2 = text.
This is a very simple statement that is working for me almost always correct. However there is a situation where the system is not able to find the record in my table. If text is equal to JAN##2011 the system won't deliver a result even if I have an entry in table1 with exactly this value.
TABLE1
field1 field2
rome JAN##2011
paris JAN2011
only if text is JAN2011 the select will find a result.
all fields are defined as CHAR.
Thanks in advancedHi Alberto,
probably ## is not ## :-).
is the visible representation used by ABAP to show any non-displayable characters as control characters like TAB, CR, LF, FF and the like.
In debugger you can switch to HEX display of values, if you see something like 0A0D you can find this using CL_ABAP_CHAR_UTILITIES constant attributes.
Regards
Clemens -
Selection Criteria addition-Not working
Hi!
I have this report wherein I need to add two fields VBAP-Kunnr and knvv-konda in the selection screen so that I can do my drill down or search criteria based upon these two selections also apart from the existing ones, but unfortunately I am unable to get throiugh this and somehow putting this two selections in the selection criteria its not taking any effect or its just actinga dummy selection and I am unale to drill down my report based upon those. Can anyone have a look and let me know what could be the problem please. Help would be highly appreciated.
Thanks
*& Include ZSD_PFGENERATETOP Report ZSD_PFGENERATE
REPORT zsd_pfgenerate LINE-SIZE 170 LINE-COUNT 65.
TABLES: lips, likp, vbap, vbak, vbrp, vbpa, vbrk.
CONSTANTS: cns_vgtyp TYPE vbrp-vgtyp VALUE 'J',
cns_intyp TYPE vbrk-vbtyp VALUE 'M',
cns_vkorg TYPE vbak-vkorg VALUE 'CA01',
cns_vkorg_US type vbak-vkorg value 'US01', "DEVK903521
cns_parsh TYPE vbpa-parvw VALUE 'WE',
cns_parsp TYPE vbpa-parvw VALUE 'AG',
cns_parre type vbpa-parvw value 'RE', "bill-to
cns_auzwp TYPE vbak-auart VALUE 'ZWP',
cns_auzct TYPE vbak-auart VALUE 'ZCT',
cns_auzif TYPE vbak-auart VALUE 'ZIF',
cns_auztm TYPE vbak-auart VALUE 'ZTM',
cns_fkff TYPE vbrk-fkart VALUE 'ZFF5',
cns_fkos TYPE vbrk-fkart VALUE 'ZOF5',
cns_upd(1) TYPE c VALUE 'S',
cns_mode(1) TYPE c VALUE 'N'.
Internal Tables and Work Areas
DATA: BEGIN OF it_vbpos OCCURS 0,
werks TYPE vbap-werks,
audat TYPE vbak-audat,
auart TYPE vbak-auart,
kunag TYPE vbak-kunnr,
name1_ag TYPE kna1-name1,
kunsh TYPE likp-kunnr,
name1_sh TYPE kna1-name1,
vbeln TYPE vbak-vbeln,
posnr TYPE vbap-posnr,
vbdel TYPE likp-vbeln,
psdel TYPE lips-posnr,
kunre type kunre, "Bill-to Party
name1_re type kna1-name1, "Bill-to Party Name
END OF it_vbpos,
BEGIN OF it_vbpos_temp OCCURS 0,
vgbel TYPE lips-vgbel,
vgpos TYPE lips-vgpos,
vbeln TYPE vbak-vbeln,
posnr TYPE vbap-posnr,
END OF it_vbpos_temp,
BEGIN OF it_report OCCURS 0,
werks TYPE vbap-werks,
vbeln TYPE vbak-vbeln,
vbdel TYPE likp-vbeln,
audat TYPE vbak-audat,
auart TYPE vbak-auart,
name1_ag TYPE kna1-name1,
name1_sh TYPE kna1-name1,
name1_re type kna1-name1, "Bill-to Party Name
mark(1) TYPE c,
END OF it_report,
BEGIN OF it_vbeln OCCURS 0,
vbeln TYPE vbak-vbeln,
END OF it_vbeln,
wa_vbeln LIKE LINE OF it_vbeln,
wa_vbpos LIKE LINE OF it_vbpos,
wa_report LIKE LINE OF it_report,
wa_sel LIKE LINE OF it_report.
DATA: it_vbrp type table of vbrp,
it_vbrk type table of vbrk.
BDC Variables
DATA: BEGIN OF bdc_tab OCCURS 0.
INCLUDE STRUCTURE bdcdata.
DATA: END OF bdc_tab.
DATA: wa_bdc LIKE LINE OF bdc_tab,
it_bdcmess TYPE TABLE OF bdcmsgcoll.
*& Selection-Screen definition
SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME TITLE text-002.
PARAMETERS: p_rdff TYPE c RADIOBUTTON GROUP rad1 DEFAULT 'X',
p_rdos TYPE c RADIOBUTTON GROUP rad1.
SELECTION-SCREEN END OF BLOCK block2.
SELECTION-SCREEN BEGIN OF BLOCK block0 WITH FRAME TITLE text-000.
SELECT-OPTIONS: s_werks FOR vbap-werks OBLIGATORY NO INTERVALS,
s_auart FOR vbak-auart,
s_kunag FOR vbak-kunnr, "Sold-to Party
s_kunnr FOR likp-kunnr, "Ship-to Party
s_kunre for vbak-kunnr, "Bill to Party
s_vdatu FOR vbak-vdatu OBLIGATORY.
SELECTION-SCREEN END OF BLOCK block0.
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.
PARAMETERS: p_vgbel TYPE vbak-vgbel.
SELECTION-SCREEN END OF BLOCK block1.
selection-screen begin of block block3 with frame title text-003.
parameters: p_billed RADIOBUTTON GROUP r1,
p_delvd RADIOBUTTON GROUP r1 default 'X',
p_all RADIOBUTTON GROUP r1.
selection-screen end of block block3.
*& Include ZSD_PFGENERATEE01
START-OF-SELECTION.
PERFORM read_report.
END-OF-SELECTION.
SET PF-STATUS 'STAT1000'.
IF it_vbpos[] IS INITIAL.
MESSAGE s999(z001) WITH 'No Data Selected for this criteria'.
ELSE.
PERFORM show_report.
ENDIF.
*& List Events
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'SELE'.
LOOP AT it_report INTO wa_report.
wa_report-mark = 'X'.
MODIFY it_report FROM wa_report.
ENDLOOP.
PERFORM show_report.
WHEN 'DSEL'.
LOOP AT it_report INTO wa_report.
wa_report-mark = ''.
MODIFY it_report FROM wa_report.
ENDLOOP.
PERFORM show_report.
ENDCASE.
AT LINE-SELECTION.
DO.
READ LINE sy-index FIELD VALUE wa_report-mark wa_report-vbeln
wa_report-vbdel.
IF sy-subrc NE 0.
EXIT.
ELSE.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_report-vbeln
IMPORTING
output = wa_report-vbeln.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_report-vbdel
IMPORTING
output = wa_report-vbdel.
READ TABLE it_report INTO wa_sel
WITH KEY vbeln = wa_report-vbeln.
IF sy-subrc EQ 0.
wa_sel-mark = wa_report-mark.
MODIFY it_report FROM wa_sel INDEX sy-tabix.
ENDIF.
ENDIF.
ENDDO.
REFRESH: it_vbeln.
LOOP AT it_report INTO wa_report WHERE mark EQ 'X'.
CASE 'X'.
WHEN p_rdff.
wa_vbeln = wa_report-vbdel.
WHEN p_rdos.
wa_vbeln = wa_report-vbeln.
ENDCASE.
APPEND wa_vbeln TO it_vbeln.
ENDLOOP.
SORT it_vbeln BY vbeln.
DELETE ADJACENT DUPLICATES FROM it_vbeln.
IF NOT it_vbeln[] IS INITIAL.
PERFORM process_vf01.
ENDIF.
*& Include ZSD_PFGENERATEF01
*& Form read_report
Routine to read applicable orders from database
FORM read_report.
DATA: lwa_lips TYPE lips,
lc_vbeln TYPE vbrk-vbeln.
Retrieve sales orders based on selection criteria where billing doc has not been
created for the delivery yet
REFRESH: it_vbeln, it_vbpos, it_report.
Select into table based on Onsite/Fixed Facility
CASE 'X'.
WHEN p_rdff.
changed for performance reasons (i.e. time-out)
k~vgbel is not in it_vbpos but was in select statment ?
SELECT vbap~werks vbak~audat vbak~auart vbak~kunnr AS kunag
vbak~vbeln vbap~posnr
INTO CORRESPONDING FIELDS OF TABLE it_vbpos
FROM vbak INNER JOIN vbap
ON vbak~mandt = vbap~mandt
AND vbak~vbeln = vbap~vbeln
WHERE vbap~werks IN s_werks
AND vbak~vdatu IN s_vdatu
AND vbak~vkorg in (cns_vkorg,cns_vkorg_US)
AND vbap~oid_ship IN s_kunnr
AND vbak~kunnr IN s_kunag
AND vbak~auart IN s_auart
AND ( vbak~auart = 'ZWP' or vbak~auart = 'ZIF' or
vbak~auart = 'ZCT' or vbak~auart = 'ZTM' or
vbak~auart = 'ZOIL' ).
IF SY-SUBRC = 0.
SELECT vgbel vgpos vbeln posnr FROM lips
INTO CORRESPONDING FIELDS OF TABLE it_vbpos_temp
FOR ALL ENTRIES IN it_vbpos
WHERE vgbel = it_vbpos-vbeln
AND vgpos = it_vbpos-posnr
%_hints oracle 'index ("LIPS" "LIPS~Z01")'.
SORT it_vbpos_temp by vgbel vgpos.
LOOP AT it_vbpos.
READ TABLE it_vbpos_temp
WITH KEY vgbel = it_vbpos-vbeln vgpos = it_vbpos-posnr
BINARY SEARCH.
IF SY-SUBRC = 0.
it_vbpos-vbdel = it_vbpos_temp-vbeln.
it_vbpos-psdel = it_vbpos_temp-posnr.
modify it_vbpos.
ENDIF.
ENDLOOP.
ENDIF.
WHEN p_rdos.
SELECT k~vbeln p~posnr k~kunnr AS kunag k~audat k~auart p~werks k~vgbel
INTO CORRESPONDING FIELDS OF TABLE it_vbpos
FROM vbak AS k INNER JOIN vbap AS p ON k~vbeln = p~vbeln
WHERE p~werks IN s_werks AND k~vdatu IN s_vdatu AND
k~vkorg in (cns_vkorg,cns_vkorg_US) AND "DEVK903521
k~vgbel EQ p_vgbel AND
k~kunnr IN s_kunag AND k~auart IN s_auart AND
p~oid_ship IN s_kunnr.
ENDCASE.
Determine if delivery has been billed out, if not can create PF Invoice - CHANGED
LOOP AT it_vbpos INTO wa_vbpos.
Check Ship-to in
SELECT SINGLE kunnr INTO wa_vbpos-kunsh FROM vbpa
WHERE parvw EQ cns_parsh AND vbeln EQ wa_vbpos-vbeln.
IF sy-subrc NE 0.
DELETE TABLE it_vbpos FROM wa_vbpos.
CONTINUE.
ENDIF.
Check for Bill-to
select single kunnr into wa_vbpos-kunre from vbpa
where parvw eq cns_parre and vbeln eq wa_vbpos-vbeln
and kunnr in s_kunre.
IF sy-subrc NE 0.
DELETE TABLE it_vbpos FROM wa_vbpos.
CONTINUE.
ENDIF.
Get Partner Texts
SELECT SINGLE name1 INTO wa_vbpos-name1_ag FROM kna1
WHERE kunnr EQ wa_vbpos-kunag.
SELECT SINGLE name1 INTO wa_vbpos-name1_sh FROM kna1
WHERE kunnr EQ wa_vbpos-kunsh.
SELECT SINGLE name1 INTO wa_vbpos-name1_re FROM kna1
WHERE kunnr EQ wa_vbpos-kunre.
CASE 'X'.
WHEN p_rdff.
IF p_delvd = 'X'.
optimized for performance reasons i.e. time-out
Check if delivery has been billed out
SELECT SINGLE k~vbeln INTO lc_vbeln
FROM vbrp AS p INNER JOIN vbrk AS k ON p~vbeln = k~vbeln
WHERE p~vgtyp EQ cns_vgtyp AND p~vgbel EQ wa_vbpos-vbdel AND
p~vgpos EQ wa_vbpos-psdel AND k~vbtyp EQ cns_intyp AND
k~fksto NE 'X'.
refresh: it_vbrp, it_vbrk.
select vbeln from vbrp
into corresponding fields of table it_vbrp
where vgtyp = cns_vgtyp and vgbel = wa_vbpos-vbdel
and vgpos = wa_vbpos-psdel
%_hints oracle 'index ("VBRP" "VBRP~Z01")'.
if sy-subrc = 0.
sort it_vbrp by vbeln.
delete adjacent duplicates from it_vbrp comparing vbeln.
select vbeln from vbrk
into corresponding fields of table it_vbrk
for all entries in it_vbrp
where vbeln = it_vbrp-vbeln
and vbtyp = cns_intyp and fksto 'X'.
IF sy-subrc EQ 0.
DELETE TABLE it_vbpos FROM wa_vbpos.
CONTINUE.
ENDIF.
endif.
ELSEIF p_billed = 'X'.
Check if delivery hasn't been billed out
SELECT SINGLE k~vbeln INTO lc_vbeln
FROM vbrp AS p INNER JOIN vbrk AS k ON p~vbeln = k~vbeln
WHERE p~vgtyp EQ cns_vgtyp AND p~vgbel EQ wa_vbpos-vbdel AND
p~vgpos EQ wa_vbpos-psdel AND k~vbtyp EQ cns_intyp AND
k~fksto NE 'X'.
refresh: it_vbrp, it_vbrk.
select vbeln from vbrp
into corresponding fields of table it_vbrp
where vgtyp = cns_vgtyp and vgbel = wa_vbpos-vbdel
and vgpos = wa_vbpos-psdel
%_hints oracle 'index ("VBRP" "VBRP~Z01")'.
if sy-subrc = 0.
sort it_vbrp by vbeln.
delete adjacent duplicates from it_vbrp comparing vbeln.
select vbeln from vbrk
into corresponding fields of table it_vbrk
for all entries in it_vbrp
where vbeln = it_vbrp-vbeln
and vbtyp = cns_intyp and fksto 'X'.
IF sy-subrc NE 0.
DELETE TABLE it_vbpos FROM wa_vbpos.
CONTINUE.
ENDIF.
endif.
ENDIF.
WHEN p_rdos.
IF p_delvd = 'X'.
Check if order has been billed out
SELECT SINGLE * FROM vbrp
WHERE vbeln EQ wa_vbpos-vbeln AND
vgpos EQ wa_vbpos-posnr.
IF sy-subrc EQ 0.
DELETE TABLE it_vbpos FROM wa_vbpos.
CONTINUE.
ENDIF.
ELSEIF p_billed = 'X'.
Check if delivery hasn't been billed out
SELECT SINGLE k~vbeln INTO lc_vbeln
FROM vbrp AS p INNER JOIN vbrk AS k ON pvbeln = kvbeln
WHERE pvgtyp EQ cns_vgtyp AND pvgbel EQ wa_vbpos-vbdel AND
pvgpos EQ wa_vbpos-psdel AND kvbtyp EQ cns_intyp AND
k~fksto NE 'X'.
refresh: it_vbrp, it_vbrk.
select vbeln from vbrp
into corresponding fields of table it_vbrp
where vgtyp = cns_vgtyp and vgbel = wa_vbpos-vbdel
and vgpos = wa_vbpos-psdel
%_hints oracle 'index ("VBRP" "VBRP~Z01")'.
if sy-subrc = 0.
sort it_vbrp by vbeln.
delete adjacent duplicates from it_vbrp comparing vbeln.
select vbeln from vbrk
into corresponding fields of table it_vbrk
for all entries in it_vbrp
where vbeln = it_vbrp-vbeln
and vbtyp = cns_intyp and fksto 'X'.
IF sy-subrc NE 0.
DELETE TABLE it_vbpos FROM wa_vbpos.
CONTINUE.
ENDIF.
endif.
ENDIF.
ENDCASE.
MOVE-CORRESPONDING wa_vbpos TO wa_report.
APPEND wa_report TO it_report.
MODIFY it_vbpos FROM wa_vbpos.
ENDLOOP.
if 'onsite field summary', then process by release sales orders
IF p_rdos = 'X'.
sort it_report by vbeln.
delete adjacent duplicates from it_report comparing vbeln.
else.
SORT it_report BY werks name1_ag name1_sh vbeln.
DELETE ADJACENT DUPLICATES FROM it_report.
endif.
SORT it_report BY name1_sh werks name1_ag vbeln.
ENDFORM. " read_report
*& Form process_vf01
Call transaction VF01 and fill screen table with order values
FORM process_vf01.
DATA: ln_index(2) TYPE n,
lc_field(20) TYPE c,
lc_fkart TYPE vbrk-fkart,
li_lines TYPE i,
lc_msgtxt(99) TYPE c,
lwa_bdcoptions TYPE ctu_params,
lwa_mess LIKE LINE OF it_bdcmess.
REFRESH: it_bdcmess.
lwa_bdcoptions-dismode = cns_mode.
lwa_bdcoptions-updmode = cns_upd.
CASE 'X'.
WHEN p_rdff.
lc_fkart = cns_fkff.
WHEN p_rdos.
lc_fkart = cns_fkos.
ENDCASE.
REFRESH: bdc_tab.
PERFORM update_bdc USING: 'X' 'SAPMV60A' '0102',
' ' 'BDC_CURSOR' 'RV60A-FKART',
' ' 'RV60A-FKART' lc_fkart,
' ' 'BDC_OKCODE' '/00'.
LOOP AT it_vbeln INTO wa_vbeln.
ln_index = sy-tabix.
Up to the second delivery of the BDC add the Delivery to the screen, after that click the More Documents for every entry. logic changed for DEVK902353
CASE ln_index.
WHEN 1.
CONCATENATE 'KOMFK-VBELN' '(' ln_index ')' INTO lc_field.
PERFORM update_bdc USING: ' ' lc_field wa_vbeln.
WHEN 2 OR 3.
IF p_rdos 'X'.
CONCATENATE 'KOMFK-VBELN' '(' ln_index ')' INTO lc_field.
PERFORM update_bdc USING: ' ' lc_field wa_vbeln,
'X' 'SAPMV60A' '0102',
' ' 'BDC_OKCODE' 'FKAN'..
ELSE.
CONCATENATE 'KOMFK-VBELN' '(' ln_index ')' INTO lc_field.
PERFORM update_bdc USING: ' ' lc_field wa_vbeln.
ENDIF.
WHEN OTHERS.
If p_rdos 'X'.
CONCATENATE 'KOMFK-VBELN' '(2)' INTO lc_field.
PERFORM update_bdc USING: ' ' lc_field wa_vbeln,
'X' 'SAPMV60A' '0102',
' ' 'BDC_OKCODE' 'FKAN'.
endif.
ENDCASE.
ENDLOOP.
VF01 will go to a different screen if only one line selected
DESCRIBE TABLE it_vbeln LINES li_lines.
IF li_lines EQ 1.
PERFORM update_bdc USING: 'X' 'SAPMV60A' '0104',
' ' 'BDC_OKCODE' '=SICH'.
ELSE.
PERFORM update_bdc USING: 'X' 'SAPMV60A' '0102',
' ' 'BDC_OKCODE' '=SICH'.
ENDIF.
CALL TRANSACTION 'VF01' USING bdc_tab OPTIONS FROM lwa_bdcoptions
MESSAGES INTO it_bdcmess.
WRITE: / 'BDC Messages:'.
SKIP.
LOOP AT it_bdcmess INTO lwa_mess.
CALL FUNCTION 'RH_MESSAGE_GET'
EXPORTING
arbgb = 'VF'
msgnr = lwa_mess-msgnr
msgv1 = lwa_mess-msgv1
msgv2 = lwa_mess-msgv2
msgv3 = lwa_mess-msgv3
msgv4 = lwa_mess-msgv4
IMPORTING
msgtext = lc_msgtxt
EXCEPTIONS
message_not_found = 1
OTHERS = 2.
WRITE: /5 lc_msgtxt.
ENDLOOP.
ENDFORM. " process_vf01
form update_bdc *
subroutine to add the data to the bdc table for trans. vf01 *
FORM update_bdc USING dynpro field content.
CLEAR bdc_tab.
IF dynpro EQ 'X'.
bdc_tab-program = field.
bdc_tab-dynpro = content.
bdc_tab-dynbegin = 'X'.
ELSE.
bdc_tab-fnam = field.
bdc_tab-fval = content.
ENDIF.
APPEND bdc_tab.
ENDFORM. "UPDATE_BDC
*& Form show_report
Report to Display Available Orders on Screen
FORM show_report .
DATA: l_idx TYPE i.
WRITE: / 'Available Orders/Deliveries for Plant:'.
LOOP AT s_werks.
WRITE: s_werks-low.
ENDLOOP.
SKIP.
FORMAT INTENSIFIED ON COLOR COL_HEADING.
WRITE: /5 text-h01, text-h02.
CASE 'X'.
WHEN p_rdff.
WRITE: text-h06.
ENDCASE.
WRITE: text-h03, text-h04, text-h05, text-h07,
/ sy-uline.
FORMAT INTENSIFIED OFF COLOR OFF.
l_idx = 0.
LOOP AT it_report INTO wa_report.
IF l_idx EQ 0.
FORMAT COLOR COL_NORMAL INTENSIFIED ON.
l_idx = 1.
ELSE.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
l_idx = 0.
ENDIF.
WRITE: / wa_report-mark AS CHECKBOX,
wa_report-auart UNDER text-h01,
wa_report-vbeln UNDER text-h02.
CASE 'X'.
WHEN p_rdff.
WRITE: wa_report-vbdel UNDER text-h06.
ENDCASE.
WRITE: wa_report-audat UNDER text-h03,
wa_report-name1_ag UNDER text-h04,
wa_report-name1_sh UNDER text-h05,
wa_report-name1_re under text-h07.
HIDE: wa_report-mark, wa_report-vbeln, wa_report-vbdel.
ENDLOOP.
ENDFORM. " show_report
Thanks for your kind help.
Aarav.Hi, Anne-Marie;
You may be running into a common issue that is docuemented here:
[SelectionFormula|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233303334333833393335%7D.do]
Regards,
Jonathan
Edited by: Jonathan Parminter on Mar 16, 2009 8:03 AM
Maybe you are looking for
-
How to translate function codes from GUI-status into other language ?
Hello experts, I've a programm called mrs - multi resource scheduling. This programm has texts in english and german. Now I want to translate the text also in italian. When I opne the programm in se80, in path GUI-status there are the ui-elements (Fu
-
How do I extract the name of the incoming file from the Header?ta
Hi all, I am using 11g TP4: I have an File Adapter Service that reads a file. In the Routing Service I want to include the name of the file that was read in the message passed onwards to the target service. Previously we used an expression like <xsl:
-
Subject: RE :(forte-users) Web enterprise & user visibleservice Objects
A few months ago we faced a similar problem while migrating from classic Forte to Web. We had to protect our investment in various frameworks that we wrote for the classic Forte apps, which made use of extensive user-level-caching among other things.
-
Oracle application server 10g -remote debugging
We have oracle application server 10g with oc4j. How do we configure App server to start in debug mode so remote debugging from different machine can be done. i configured remote debugging options in opmn.xml .in the jdeveloper i attached to JPDA .wh
-
How to clone DB from 2node instance using BCVs
Hello: I need some help in figuring out how to take Remote BCVS and restore the data to another 2 Node cluster with duplicate database using ASM. Hotbackup of prod1 and archive backup using BCVS Here is my Prod architecture 2Nodecluster RmanServer 2N