Html code in JButton not working
hi all,
i wrote html code in JButton,but it's not working,it is displaying all the code what i have placed in the html tag.this message is displaying in button.
"<html><STYLE=\"font-family: Dialog; font-size: 12pt\"><center>Current<br>Date</center></STYLE></html"
JButton but1 = new JButton("<html><STYLE=\"font-family: Dialog; font-size: 12pt\"><center>Current<br>Date</center></STYLE></html>");
Thanks in advance
bhaskar
will it work in java 1.2 or not
bhaskar
Similar Messages
-
The code insight does not work for me. I followed the advice of Steve Muench given here:
http://radio.weblogs.com/0118231/stories/2003/01/17/whyIsntMyCodeInsightWorking.html
but that did not change the problem. The problem seems to be related to new java 1.5 features. As soon as I start using generics the code insight is lost...
Any clues what is going on? I s this easy to fix?
-- example: (NOTE that iI use double (( )) to indicate generics definitions. the forum software would not let me put in the correct syntax!)
package mypackage;
import java.util.Set;
public class tester1
private Set ((Integer)) intSet = null;
public tester1()
intSet. ---- NO CODE INSIGHT POPS UP! (if i change to "private Set intSet = null;" it works)
public static void main(String[] args)
new tester1();
P.S.
Also, i noticed that the auto-import ist not working for the "Set((Integer))" line!
Message was edited by:
user444936thanks for the info.
Hmm - too bad. I may have to switch to eclipse or something then, since my project involves some 1.5 parts and the missing code insights and import features are a real pain for me.
Cheers,
Jochen -
SAP Inbox t code sbwp is not working properly
Hi,
In our SAP server the SAP mail box t code SBWP is not working at a particular time between 11 AM to 12 AM. If we send internal mails between SAP users in t code SBWP we are able to receive all the time but at a particular time of 11 AM to 12 AM we are not able to receive any mail.
If we send any mail at that particular time after 11 AM we are receiving it only after 12 AM, but this error we are not facing expect that particular time.
I have checked whether any backgroung work process is Active at that time but all the BG work process are free at that time
please help me how to solve this issue.
Thanks
Senthilhi
check out this sap note
1348288 Delayed delivery of documents in SBWP -
Code completion particular not working
Hello,
in my program there are serveral internal classes. Each class has its own include file. Code completion seems not working for internal classes in other include files.
example:
lcl_class1 in includec01 (first included)
class-methods static1_1
methods method1_1
lcl_class2 in includec02 (second included)
class-methods static1_1
methods method1_1
problem:
While development in lcl_class2 there are no code completion for lcl_class1.
No code completation for lcl_class1=>static1_1
but if you declarate "data lo_myclass type ref to lcl_class1." code completion is working fine for public member methods and attributes in the same file.
In Functiongroups all working fine.
Best Regards
Markus Bauernschmitt
Und da hier eh die meisten deutschsprachig sind und mein Englisch grausam ist, nachfolgend die Erklärung nochmal auf deutsch.... ;-)
In meinen Programmen findet die Codevervollständigung keine interne Klassen aus vorangegangenen include Dateien. Dadurch werden weder die Klassen selbst noch die statischen Methoden angezeigt. Gebe ich eine statische Methode ein und möchte die Hilfe anzeigen (F2) erscheint die Fehlermeldung "Codeinformationen sind nicht verfügbar".
Dieses Problem tritt nicht auf, falls die Deklaration einer Variablen in der gleichen Include Datei erfolgt.
Deklaration einer Variablen in der aktuellen Include Datei -> Dokumentation der öffentlichen (nicht statische) Methoden und Attribute funktioniert
Zugriff auf öffentliche (statische oder nicht statische) Methoden und Attribute von globalen Variablen (deklariert in einer anderen Datei) funktioniert dagegen nicht.
Es sind nur anscheinend nur Programme betroffen. Bei Funktionsgruppen (getestet am Beispiel "ldemo_cr_car_rental_screen") trat der Fehler nicht auf.Hi Dominik,
thank you for your answer. The internal classes are already simple and lightweight. In my understanding of OO I keep classes private as possible and so I create this specific "one program helper classes" in the smallest reasonable scope.
However, this is a architektur decission. But the pivotal question is: Why working this kind of code completion in function groups but not in programs.
Some additional information.
- Code completion working in "START-OF-SELECTION."
- In Functiongroup includes (Testcase lcl_class1 show as public type and lcl_class2 show as local public class.
Best regards
Markus -
Help and support sends you in circles and does not help redeem a card with a code that does not work.
Well, they have a website, but here is a link to their information about unlocking iPhones.
http://www.att.com/esupport/article.jsp?sid=KB414532&cv=820#fbid=6d7EKuCF_dr
You may not qualify for an unlock though. -
Code completion does not work with table alias
Hi all,
When i use SQL developer to create a simple query like below i alias my tables so i can oversee it better.
select
* from PRODUCTS p
inner join PRODUCT_TYPES pt on PRODUCT_TYPES.PRODUCT_TYPE_ID = p.But when i give the driving table a alias like p and i try to do a join like you see in the code SQL developer will not show the columns from table PRODUCTS.
What do i wrong or is this a bug?
Thanks in advance,
DanielHi,
Sue, there are lots of code completion don't work either.
Some of them are :
1. The code completion seems not working if we put double-quote ("") to enclosed the object name.
SELECT t. -- CTRL+Space the code completion won't work here
FROM MYSCHEMA."MYTABLE" t 2. The code completion also not working if we state some characters of the column name, although it still works for the uncomplete object name
i.e the name of the column is : MYFIELD
SELECT t.MY -- CTRL+Space, the code completion won't work here
FROM MYSCHEMA.MYTABLE t 3. Sometimes, I can see two code completion lists when I use CTRL + Space
Usually, it happens on the first connection's SQL Worksheet, the second and so forth are fine.
SELECT t. -- CTRL+Space, shows two lists which I can choose both of them
FROM MyTable t4. Code completion also not working when we try to access object from other schema. tbeech post it on
Re: Code Assist -- Table Alias
Are those code completion bugs are also logged?
Regards,
Buntoro -
CODE ADDED using HTML Snippet Widget does not work
I am trying to add some code to a web page using the HTML Snippet widget and it does not work on my page. the code is as follows:
<script src='http://adn.ebay.com/files/js/min/ebay_activeContent-min.js'></script>
<script src='http://adn.ebay.com/cb?programId=1&campId=5336536214&toolId=10026&keyword= coinset+nationaruba&catId=11116&width=728&height=90&font=1&textColor=333366&linkColor=333333&a rrowColor=8BBC01&color1=B5B5B5&color2=FFFFFF'></script>
Can anyone help me to get this to work?
Thanks!
GreggI got this code from Ebay. It is an Ebay partner link.
Gregg -
HTML multipart form is not working in jsp page
Hi
i have jsp page, has a HTML from with file upload field , when i click the send button , nothing happened as if the button did not submit the form. ie the message at line 12 is not printed out.
can any one help please.
<%@ page errorPage="..\error\error.jsp" %>
<%@ page pageEncoding="windows-1256" %>
<%@ page language="java" import="javazoom.upload.*,java.util.*,java.sql.ResultSet" %>
<jsp:useBean id="upBean" scope="page" class="javazoom.upload.UploadBean" >
<jsp:setProperty name="upBean" property="folderstore" value="<%=request.getRealPath("thuraya//uploads")%>" />
</jsp:useBean>
<jsp:useBean id="dbc" class="mypackage.DBConnection" scope="session" />
<!-- add news-->
<%
if(request.getParameter("addBTN") != null){
out.println("addbtn");
//do upload file + insert in database
if (MultipartFormDataRequest.isMultipartFormData(request))
// Uses MultipartFormDataRequest to parse the HTTP request.
MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);
String todo = null;
if (mrequest != null) todo = mrequest.getParameter("todo");
if ( (todo != null) && (todo.equalsIgnoreCase("upload")) )
Hashtable files = mrequest.getFiles();
if ( (files != null) && (!files.isEmpty()) )
UploadFile file = (UploadFile) files.get("filename");
if (file != null)
out.println("<li>Form field : uploadfile"+"<BR> Uploaded file : "+file.getFileName()+" ("+file.getFileSize()+" bytes)"+"<BR> Content Type : "+file.getContentType());
String fileName=file.getFileName();
String ran=System.currentTimeMillis()+"";
String ext=fileName.substring( ( fileName.length()-4),fileName.length() );
file.setFileName(ran+ext);
// Uses the bean now to store specified by jsp:setProperty at the top.
upBean.store(mrequest, "filename");
String title=request.getParameter("title");
String content=request.getParameter("elm1");
int x=dbc.addNews(title,content,file.getFileName(),2,1);
if(x==1)
out.print("New Vedio has been addedd Successfully");
response.setHeader("Refresh","1;URL=uploadVedio.jsp");
else{
out.print("An Error Occured while adding new Vedio");
response.setHeader("Refresh","1;URL=uploadVedio.jsp");
else
out.println("<li>No uploaded files");
else out.println("<BR> todo="+todo);
%>
<!-- end of add news-->
<form action="" method="post" enctype="multipart/form-data" name="upform" >
<table width="99%" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td colspan="2" align="right" bgcolor="#EAEAEA" class="borderdTable"><p>'6'A) .(1 ,/J/</p></td>
</tr>
<tr>
<td width="87%" align="right"><label>
<input name="title" type="text" class="rightText" id="title">
</label></td>
<td width="13%" align="right">9FH'F 'D.(1</td>
</tr>
<tr>
<td align="right"><textarea name="elm1" cols="50" rows="10" id="elm1" style="direction:rtl" >
</textarea></td>
<td align="right">*A'5JD 'D.(1</td>
</tr>
<tr>
<td align="right"><label>
<input type="file" name="filename" id="filename">
</label></td>
<td align="right">5H1)</td>
</tr>
<tr>
<td align="right"><label>
<input onClick="submit()" name="addBTN" type="button" class="btn" id="addBTN" value=" '6'A) .(1 ">
</label></td>
<td align="right"> </td>
</tr>
</table>
</form>
<!-- TinyMCE -->
<script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "simple",
directionality : "rtl"
</script>
<!--end of TinyMCE -->the problem is not because of java code insdie jsp page
I have removed all things but the form and it is still not working
here is the modified code:
<!-- add news-->
<%
if(request.getParameter("addBTN") != null){
out.print("addBTN");
%>
<!-- end of add news-->
<form action="" method="post" enctype="multipart/form-data" name="upform" >
<table width="99%" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td colspan="2" align="right" bgcolor="#EAEAEA" class="borderdTable"><p>'6'A) .(1 ,/J/</p></td>
</tr>
<tr>
<td width="87%" align="right"><label>
<input name="title" type="text" class="rightText" id="title">
</label></td>
<td width="13%" align="right">9FH'F 'D.(1</td>
</tr>
<tr>
<td align="right"><textarea name="elm1" cols="50" rows="10" id="elm1" style="direction:rtl" >
</textarea></td>
<td align="right">*A'5JD 'D.(1</td>
</tr>
<tr>
<td align="right"><label>
<input type="file" name="filename" id="filename">
</label></td>
<td align="right">5H1)</td>
</tr>
<tr>
<td align="right"><label>
<input name="addBTN" type="submit" class="btn" id="addBTN" value=" '6'A) .(1 ">
</label></td>
<td align="right"> </td>
</tr>
</table>
</form>
<!-- TinyMCE -->
<script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "simple",
directionality : "rtl"
</script>
<!--end of TinyMCE --> -
Hello All,
I have a Muse HTML item placed on the page... the contents contain the following:
<div class="bodyarea">
{tag_pagecontent}
</div>
.bodyarea is stored in a style sheet outside of muse....
When I publish to Catalyst from Muse, my "Page Content" is not surrounded by the "bodyarea" div
Does the HTML item delete all other html or code when the {tag_pagecontent} tag is placed withing in ????
ThanksHi Brad,
I'm still in development, so I'm not paying for it just yet...
Correct... I have a several template pages in Muse, on one of the template pages I have an HTML object with the following code inside of it... I figured, I'd add the .bodyarea div inside of Muse, so I do not have to add it within the "Content" area of every page I create in Catalyst that uses this template.
<div class="bodyarea">
{tag_pagecontent}
</div>
.bodyarea is defined withing my modulestylesheets.css file
When I add the following from within a Catalyst page that uses the Muse template, the styles take affect...
<div class="bodyarea">
page content, blah, blah....
</div>
As before, when I define the <div> from with Muse, it doesn't show up in the html when I preview the code.
Does that make sense?
Just wondering why within the "html" object in muse, it's not working.
Also, yes... the page that I was testing has that template applied to it.
Thank you -
Why does my JButton not work?
Hi,
I am programming a Traffic Light, consisting of 3 lights, and a caption describing who's Traffic Light it is. Traffic Lights are to be used inside a bigger program. But as it is, I'm trying out how to program one Traffic Light.
I created a Light object. A TrafficLight object contains 3 of these objects, and a caption. The TrafficLight object is to be used as a button, so the user can push it, after which some magic has to happen, which I still need to develop. The problem I have is the button does not work.
So, the relevant parts of the code. First the main:
public static void main (String [] args) {
JFrame frame = new JFrame();
frame.setBounds(0, 0, 100, 400);
TrafficLight light = new TrafficLight("Caption", "ERR", true);
frame.add(light);
// frame.pack();
frame.setVisible(true);
}Then the TrafficLight object:
public TrafficLight () {
setUp();
private void setUp() {
JComponent component = createComponent();
add(component);
setVisible (true);
private JComponent createComponent () {
JPanel panel = new JPanel(null);
panel.setBounds (xCoordinate, yCoordinate, WIDTH, HEIGHT);
JButton tlsButton = new JButton();
tlsButton.setBounds(xCoordinate, yCoordinate, WIDTH, HEIGHT);
boolean isOn = true;
boolean isNewProblem = true;
tlsButton.setActionCommand(name);
tlsButton.addActionListener(this);
// Create the lights
redLight = new TlsLight (0, 0, Color.RED, isOn, isNewProblem);
tlsButton.add(redLight);
yellowLight = new TlsLight (0, WIDTH, Color.YELLOW, !isOn, isNewProblem);
tlsButton.add(yellowLight);
greenLight = new TlsLight (0, 2 * WIDTH, Color.GREEN, isOn, !isNewProblem);
tlsButton.add(greenLight);
tlsButton.add(customerLabel, Component.CENTER_ALIGNMENTl);
panel.add(tlsButton);
return panel;
}And, finally, the TlsLight object:
public void paint (Graphics graphics) {
setSize(width, width);
int diameter = width - 2 * insets;
// Paint the background (square) based on if the Customer has a new problem or not
if(isNewProblem) {
background = Color.GRAY;
else {
background = Color.BLACK;
graphics.setColor(background);
graphics.fillRect(xPos, yPos, width, height);
// Set color light based on problemStatus
if(isOn) {
graphics.setColor(theColor);
} else {
graphics.setColor(background);
graphics.fillOval(xPos + insets, yPos + insets, diameter, diameter);
// Set the background of the light
graphics.setColor(Color.WHITE);
// Paint the background
graphics.drawOval(xPos + insets, yPos + insets, diameter, diameter);
}When I push the button, nothing happens. Do you know what I need to do to get my prog working?
TIA,
AbelI don't know what goes on in your ActionListener, but I have a feeling that something is missing there.
public TrafficLight () {
setUp();
private void setUp() {
JComponent component = createComponent();
add(component);
setVisible (true);
private JComponent createComponent () {
JPanel panel = new JPanel(null);
panel.setBounds (xCoordinate, yCoordinate, WIDTH, HEIGHT);
JButton tlsButton = new JButton();
tlsButton.setBounds(xCoordinate, yCoordinate, WIDTH, HEIGHT);
boolean isOn = true;
boolean isNewProblem = true;
tlsButton.setActionCommand(name);
//tlsButton.addActionListener(this);
tlsButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt){
System.out.println("Hello World!"); //Implement with you own stuff....
// Create the lights
redLight = new TlsLight (0, 0, Color.RED, isOn, isNewProblem);
tlsButton.add(redLight);
yellowLight = new TlsLight (0, WIDTH, Color.YELLOW, !isOn, isNewProblem);
tlsButton.add(yellowLight);
greenLight = new TlsLight (0, 2 * WIDTH, Color.GREEN, isOn, !isNewProblem);
tlsButton.add(greenLight);
tlsButton.add(customerLabel, Component.CENTER_ALIGNMENTl);
panel.add(tlsButton);
return panel;
} -
Android – html with dropdown menu not working
hi everybody,
I'm creating a digital pubblication fo android and I'm testing it on an Asus tablet.
I just have a big html widget showing a local web application. Everything works except a simple dropdown menu: when I tap on the button that should open the dropdown items, the button highlights itself, but the options don't appear.
this the HTML code:
Size: 4
4,5
5
5,5
6
6,5
7
7,5
8
8,5
9
9,5
10
10,5
11
11,5
12
12,5
13
13,5
I'm sure it worked on a Samsung tablet (within the DPS app), and it works on the Asus if I access to the application via browser.
it only doesn't work when loading it within the DPS app on the Asus device. is the tablet brand the problem?
my android version is: 4.2.2.
anybody can help me, please?
thank you very much.it works with the native android viewer!
but with this there's another problema (that the legacy one doesn't have): I have a simple form and the last text field appears beneath the keyboard.
with the legacy viewer each time I move the focus from a textfield to the next one, the text field moves upwards to be visible (and not hidden by the keyboard).
this is the code for the form:
<div data-role="fieldcontain" class="text-field">
<label for="firstname">Nome:</label>
<input type="text" name="firstname" value="" placeholder="" class="required" id="firstname" />
</div>
<div data-role="fieldcontain" class="text-field">
<label for="surname">Cognome:</label>
<input type="text" name="surname" value="" placeholder="" class="required" id="surname" />
</div>
<div data-role="fieldcontain" class="text-field">
<label for="surname">Indirizzo:</label>
<input type="text" name="address" value="" placeholder="" id="address" class="required"/>
</div>
<div data-role="fieldcontain" class="text-field">
<label for="email">Email:</label>
<input type="email" name="email" value="" placeholder="" class="required" id="email" title="Your error message" />
<div class='error_message'></div>
</div>
<div data-role="fieldcontain" class="text-field note">
<label for="message">Note :</label>
<textarea name="message" id="message" placeholder="" ></textarea>
</div>
<div data-role="fieldcontain" class="text-field mail">
<label for="email_shop">Email negozio:</label>
<input type="email" name="email_shop" value="" placeholder="" class="required" id="email_shop" />
</div> -
Move jsp code into servlet, not work!!
Hi:
I am new in servlet and java, I can use jdom to read xml file
into a jsp file, but whan I move jsp code into servlet, they are not work
have any ideals?
Thank!Hi:
my.jsp
<%@ page contentType="text/html"%>
<%@ page import="java.io.File,
java.util.*,
org.jdom.*,
org.jdom.input.SAXBuilder,
org.jdom.output.*" %>
<%
String Records = "c:/XMl/Quotes.xml";
SAXBuilder builder = new SAXBuilder("org.apache.xerces.parsers.SAXParser");
Document l_doc = builder.build(new File(Records));
my servlet
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.jdom.*;
import org.jdom.input.*;
import org.jdom.input.SAXBuilder;
import org.jdom.output.*;
public class XmlJdom extends HttpServlet
String Records = "c:/xml/Quotes.xml";
SAXBuilder builder = null;
Element Author = null;
Element Text = null;
Element Date = null;
* Initializes the servlet.
public void init(ServletConfig config) throws ServletException
super.init(config); //pass ServletConfig to parent
try
// JDOM can build JDOM trees from a variety of input sources. One
// of those input sources is a SAX parser.
SAXBuilder builder = new SAXBuilder("org.apache.xerces.parsers.SAXParser");
catch ( org.jdom.JDOMEXception e)
public void doGet(
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
PrintWriter out = null;
out = response.getWriter();
try{
Document l_doc = builder.build(new File(Records));
Element root = l_doc.getRootElement();
//get a list of all recode in my XML document
String l_pages = root.getChild("quote");
String Iterator e = l_pages.iterator();
while ( e.hasNext())
Element l_quote= (Element) e.next();
Element l_Author = l_quote.getChild("Date").getChild("Text");
XMLOutputter l_format = new XMLOutputter();
String ls_result = l_format.outputString(l_doc);
out.println(ls_result);
catch( org.jdom.JDOMException e )
finally
if( out != null)
out.close();
Please tell me, what is wrong!!!
Element root = l_doc.getRootElement();
/* get a list of all the links in our XML document */
List l_pages = root.getChildren("quote");
Iterator Myloop = l_pages.iterator();
while ( Myloop.hasNext())
Element l_quote= (Element) Myloop.next();
Element l_Author = l_quote.getChild("Date").getChild("Text");
XMLOutputter l_format = new XMLOutputter();
String ls_result = l_format.outputString(l_doc);
ls_result = l_format.outputString(l_doc);
%>
<html><head><title></title></head>
<body>
<pre>
<%=ls_result%>
</pre>
</body>
</html> -
Redemption code summit is not working
I bought the photpshop elements 12, and input the redemption code, but it is not working. does the system problem?
You must convert a Redemption code to a serial number. Follow the instructions at http://helpx.adobe.com/x-productkb/global/redemption-code-help.html.
Cheers,
Neale
Insanity is hereditary, you get it from your children
If this post or another user's post resolves the original issue, please mark the posts as correct and/or helpful accordingly. This helps other users with similar trouble get answers to their questions quicker. Thanks. -
Html embeded in footer not working
I have had a footer with a "counter" and the adobe muse "badge" for over a year. now the text boxes display, and the facebook counter is OK. my page "hit" counter no longer works and the adobe muse badge doesn't display. it looks fine on the design page when I publish the page or even preview it , the former items don't work.
has Adobe done something with embeded HTML code. my goggle calendar is suddenly a mess too!!
I have a separate post about the calendar problem, but now it seems it's is a HTML embed problem site wide.
Please Help. should I go to Muse CC immediately. I trying to finalize this site for a client, and now I have issues with pages/parts that have be OK for nearly a year? so very confused.
here is the design page:
here is the page in safari ( same in preview mode ) but it worked fine for months and I have not changed anything
in these code snippets.
here is the counter code: ( can someone recommend a good, safe place to get a hit counter ? )
<!-- Counter Code START -->
<style type="text/css">#counter_140540 {font-family: "Verdana"; font-size: 12px; clear: left; color: #BBBBBB;} #counter_140540 a {color: #BBBBBB;}#counter_div_140540 {height: 21px}</style><div id="counter_div_140540"></div><p id="counter_140540"><span></span> <a target="_blank" href="http://utbildningsbloggen.wordpress.com/category/niclas-kjellstrom-matseke/"> </a> <span></span></p><script type="text/javascript" src="http://counter.website-hit-counters.com/bright-green/140540"></script>
<!-- Counter Code END -->
here is the adobe badge:
<a href="http://muse.adobe.com" rel="Muse beta by Adobe"><img src="http://muse.adobe.com/made-with-muse-badge/made-with-muse-110x49-for-dark-bg.png" alt="Muse beta by Adobe" width="110" height="45" /></a>
thank you for any assistance.thank you for your reply,
here is the home page URL:
http://farandawayfarms.businesscatalyst.com/index.html
There are about 10 master pages ( yes a problem I know)
all the top level pages come from one master.
the children pages off each top level have their own master page and a separate copy of the footer, header, and menu bar,
for each master.
the HTML in the footers do not work on any of the pages, so all the footers on all the master pages are not executing.
the Visitors ->MapInfo page shows the header pushed half way off the page. I did delete the google map, as it has some odd error
and added it back again , so I have made a change to that page.
http://farandawayfarms.businesscatalyst.com/mapinfo.html
also the google calendar display is broken too and show very odd formatting for display, nothing like the one week default
and calendar entries I set up in the google customize calendar html for expert tool
Calendar -> Weekly Lesson is the calendar page. I have added the code at least a dozen times. it finally looked ok,
but then when you come back to the web site, it is all corrupted again. the display in the muse design .
http://farandawayfarms.businesscatalyst.com/weeklylessons.html
all the masters are stand alone, except that I applied the "main master" to the Visitors master , and thus the Visitors hierachry.
i tried to attach my website ".muse" file, but it is larger than 25 Mb, so yahoo rejected it.
I saw a note somewhere about sending larger files using some Adobe file tool, so I"ll try to find it.
I don't know what is going on. I do know that all my html code was fine a couple months ago, and now none of it seems to
be executing properly. I have not changed any of the footers.
I will post this in the discussion forum too. just for completeness..
Lynn -
Hi ALL i have a BDC code it is not working properly
this BDC code is not working properly , when ever the file is transfering BDC is aborting in the case of invalid material/batch comes into teh picture... so please could you ''Check for invalid material/batch combinations so they are not processed by the BDC in the program and correctly output in an exception report''
*****************************CODE HERE*****************************
S E L E C T I O N S C R E E N
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: p_file LIKE rlgrap-filename,
p_arch LIKE rlgrap-filename. "RM080107
SELECTION-SCREEN SKIP.
PARAMETERS: p_mode LIKE ctu_params-dismode DEFAULT 'N'.
SELECTION-SCREEN END OF BLOCK b1.
I N C L U D E S
INCLUDE zwm_np_stock_recon_top.
INCLUDE zwm_np_stock_recon_f01.
I N I T I A L I Z A T I O N
INITIALIZATION.
PERFORM get_interface_filename USING c_interface_file p_file.
PERFORM get_interface_filename USING c_archive_file p_arch."RM080107
S T A R T O F S E L E C T I O N
START-OF-SELECTION.
PERFORM read_file USING p_file.
PERFORM pre_processing.
E N D O F S E L E C T I O N
END-OF-SELECTION.
PERFORM process_checks.
IF w_no_change = 'X'.
WRITE: / text-b03.
WRITE: / sy-uline(34).
ELSE.
PERFORM bdc_mi09.
PERFORM file_check_report.
PERFORM bdc_report.
ENDIF.
PERFORM post_process_checks.
*-- Move the processed file to archive directory
PERFORM move_file.
...*************.........first include...................************
INCLUDE ZWM_NP_STOCK_RECON_TOP *
Data declaration ----------------------------------------------
TYPES: st_rawdata(2000) TYPE c.
TYPES: BEGIN OF st_stck_cnt,
werks TYPE iseg-werks, "plant
lgort TYPE iseg-lgort, "storage location
matnr TYPE iseg-matnr, "material number
charg TYPE iseg-charg, "batch
vfdat TYPE mch1-vfdat, "Sell by date
lwedt TYPE mch1-lwedt, "Manufacture date
quarn(8) TYPE n, "qaunrantine quantity
menge(8) TYPE n, "quantity on hand
message(1), "Message Type (E/W/I)
msg_txt TYPE t100-text, "Message Text
zerostck(1), "Zero stock identifier "RM220307
END OF st_stck_cnt.
TYPES: BEGIN OF st_batch_errors,
matnr TYPE iseg-matnr, "material number
charg TYPE iseg-charg, "batch
clabs TYPE mchb-clabs, "Stock Balance
END OF st_batch_errors.
DATA:
t_rawdata TYPE TABLE OF st_rawdata,
w_rawdata TYPE st_rawdata,
t_stck_cnt TYPE TABLE OF st_stck_cnt,
d_stck_cnt TYPE TABLE OF st_stck_cnt, "RM191006
w_stck_cnt TYPE st_stck_cnt,
t_batch_errors TYPE TABLE OF st_batch_errors,
w_batch_errors TYPE st_batch_errors,
t_messtab LIKE bdcmsgcoll OCCURS 0,
w_messtab LIKE LINE OF t_messtab,
w_no_change.
CONSTANTS: c_interface_file(26) TYPE c VALUE 'ZNP_STOCK_RECON',
c_archive_file(26) TYPE c
VALUE 'ZNP_STOCK_RECON_ARCHIVE'. "RM080107
.*************................second include..........************
***INCLUDE ZWM_NEXTPHARMA_STOKRECON_F01 .
*& Form read_file
reads NextPharma file sent through via webmethods
-->P_FILENAME
FORM read_file USING p_filename.
CLEAR: t_rawdata,
w_rawdata.
REFRESH: t_rawdata.
OPEN DATASET p_filename FOR INPUT IN TEXT MODE.
IF sy-subrc <> 0.
MESSAGE e720(01).
ENDIF.
DO.
READ DATASET p_filename INTO w_rawdata.
IF sy-subrc <> 0.
EXIT.
ELSE.
APPEND w_rawdata TO t_rawdata.
ENDIF.
ENDDO.
CLOSE DATASET p_filename.
ENDFORM. " read_file
*& Form pre_processing
Read file values into internal table
FORM pre_processing.
DATA: lw_matnr TYPE iseg-matnr.
LOOP AT t_rawdata INTO w_rawdata.
lw_matnr = w_rawdata+21(20). "RM031006
lw_matnr = w_rawdata+22(18). "RM031006
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = lw_matnr
IMPORTING
output = lw_matnr
EXCEPTIONS
length_error = 1
OTHERS = 2.
MOVE: lw_matnr TO w_stck_cnt-matnr.
w_stck_cnt-werks = w_rawdata+14(4).
w_stck_cnt-lgort = w_rawdata+18(4).
w_stck_cnt-charg = w_rawdata+84(25).
w_stck_cnt-vfdat = w_rawdata+109(8).
w_stck_cnt-lwedt = w_rawdata+117(8).
w_stck_cnt-quarn = w_rawdata+141(8).
w_stck_cnt-menge = w_rawdata+125(8).
APPEND w_stck_cnt TO t_stck_cnt.
CLEAR w_stck_cnt.
ENDLOOP.
SORT t_stck_cnt BY werks
lgort
matnr
charg.
DELETE ADJACENT DUPLICATES FROM t_stck_cnt.
ENDFORM. " pre_processing
*& Form bdc_mi09
Run file data via BDC TCODE: MI09
FORM bdc_mi09.
DATA: t_bdcdata TYPE TABLE OF bdcdata,
w_bdcdata TYPE bdcdata,
lw_datum(10) TYPE c,
lw_count(2) TYPE n.
WRITE sy-datum TO lw_datum DD/MM/YYYY.
Front Screen
CLEAR w_bdcdata.
w_bdcdata-program = 'SAPMM07I'.
w_bdcdata-dynpro = '0700'.
w_bdcdata-dynbegin = 'X'.
APPEND w_bdcdata TO t_bdcdata.
Enter
CLEAR w_bdcdata.
w_bdcdata-fnam = 'BDC_OKCODE'.
w_bdcdata-fval = '/00'.
APPEND w_bdcdata TO t_bdcdata.
Count Date
CLEAR w_bdcdata.
w_bdcdata-fnam = 'RM07I-ZLDAT'.
w_bdcdata-fval = lw_datum.
APPEND w_bdcdata TO t_bdcdata.
Document Date
CLEAR w_bdcdata.
w_bdcdata-fnam = 'RM07I-BLDAT'.
w_bdcdata-fval = lw_datum.
APPEND w_bdcdata TO t_bdcdata.
Plant
CLEAR w_bdcdata.
w_bdcdata-fnam = 'IKPF-WERKS'.
w_bdcdata-fval = w_stck_cnt-werks.
APPEND w_bdcdata TO t_bdcdata.
Storage Location
CLEAR w_bdcdata.
w_bdcdata-fnam = 'IKPF-LGORT'.
w_bdcdata-fval = w_stck_cnt-lgort.
APPEND w_bdcdata TO t_bdcdata.
LOOP AT t_stck_cnt INTO w_stck_cnt.
Do not submit items with Errors against them
CHECK w_stck_cnt-message NE 'E' AND
w_stck_cnt-zerostck NE 'X'.
"RM220307
lw_count = lw_count + 1.
Input Screen
CLEAR w_bdcdata.
w_bdcdata-program = 'SAPMM07I'.
w_bdcdata-dynpro = '0731'.
w_bdcdata-dynbegin = 'X'.
APPEND w_bdcdata TO t_bdcdata.
Page Down
CLEAR w_bdcdata.
w_bdcdata-fnam = 'BDC_OKCODE'.
w_bdcdata-fval = '=P+'.
APPEND w_bdcdata TO t_bdcdata.
Material
CLEAR w_bdcdata.
w_bdcdata-fnam = 'ISEG-MATNR(01)'.
w_bdcdata-fval = w_stck_cnt-matnr.
APPEND w_bdcdata TO t_bdcdata.
Batch
CLEAR w_bdcdata.
w_bdcdata-fnam = 'ISEG-CHARG(01)'.
w_bdcdata-fval = w_stck_cnt-charg.
APPEND w_bdcdata TO t_bdcdata.
IF w_stck_cnt-menge NE 0.
Quantity
CLEAR w_bdcdata.
w_bdcdata-fnam = 'ISEG-ERFMG(01)'.
w_bdcdata-fval = w_stck_cnt-menge.
APPEND w_bdcdata TO t_bdcdata.
*-- Begin RM220307 - We need to create an item when the quantity is zero
*-- in file and is non-zero in SAP
ELSE.
Zero Stock indicator
CLEAR w_bdcdata.
w_bdcdata-fnam = 'ISEG-XNULL(01)'.
w_bdcdata-fval = 'X'.
APPEND w_bdcdata TO t_bdcdata.
*-- End RM220307
ENDIF.
ENDLOOP.
CHECK lw_count NE 0.
After all line items have been input
Final Screen
CLEAR w_bdcdata.
w_bdcdata-program = 'SAPMM07I'.
w_bdcdata-dynpro = '0731'.
w_bdcdata-dynbegin = 'X'.
APPEND w_bdcdata TO t_bdcdata.
Save Document
CLEAR w_bdcdata.
w_bdcdata-fnam = 'BDC_OKCODE'.
w_bdcdata-fval = '=BU'.
APPEND w_bdcdata TO t_bdcdata.
CALL TRANSACTION 'MI09' USING t_bdcdata
MODE p_mode
MESSAGES INTO t_messtab.
ENDFORM. " bdc_mi09
*& Form bdc_report
Write BDC Messages.
FORM bdc_report.
DATA: lw_text TYPE t100-text.
SKIP.
WRITE: / text-b01.
WRITE: / sy-uline(21).
SKIP.
Write BDC Messages
LOOP AT t_messtab INTO w_messtab WHERE msgspra = sy-langu.
MESSAGE ID w_messtab-msgid TYPE w_messtab-msgtyp
NUMBER w_messtab-msgnr
WITH w_messtab-msgv1
w_messtab-msgv2
w_messtab-msgv3
w_messtab-msgv4
INTO lw_text.
WRITE: / lw_text.
ENDLOOP.
ENDFORM. " bdc_report
*& Form process_checks
Perform process check before creating BDC Session
FORM process_checks.
DATA: lw_clabs LIKE mchb-clabs,
lw_menge LIKE mchb-clabs,
lw_matnr LIKE mara-matnr,
lw_charg LIKE mch1-charg,
lw_fail,
lw_vfdat TYPE mch1-vfdat,
lv_sell TYPE c, "RM191006
lv_qty(8) TYPE c. "RM191006
CLEAR: d_stck_cnt[], d_stck_cnt. "RM191006
Check if any of the stock figures differ from current stock figures
LOOP AT t_stck_cnt INTO w_stck_cnt.
lw_menge = w_stck_cnt-menge.
SELECT SINGLE clabs INTO lw_clabs
FROM mchb
WHERE matnr = w_stck_cnt-matnr
AND werks = w_stck_cnt-werks
AND lgort = w_stck_cnt-lgort
AND charg = w_stck_cnt-charg.
IF sy-subrc = 0.
IF lw_clabs NE lw_menge.
lw_fail = 'X'.
*-- Begin RM220307 - Do not create PI item if the stock is zero in the
*-- file and is zero in SAP
EXIT.
ELSEIF lw_clabs = 0 AND lw_menge = 0.
w_stck_cnt-zerostck = 'X'.
MODIFY t_stck_cnt FROM w_stck_cnt.
ENDIF.
*-- End RM220307
ELSE.
lw_fail = 'X'.
ERROR
ENDIF.
ENDLOOP.
If no differences are found set NO CHANGE Flag
IF lw_fail NE 'X'.
w_no_change = 'X'.
EXIT.
ENDIF.
Check for Errors in file data
LOOP AT t_stck_cnt INTO w_stck_cnt.
CLEAR lv_sell. "RM191006
SELECT SINGLE matnr INTO lw_matnr
FROM mara
WHERE matnr = w_stck_cnt-matnr.
IF sy-subrc NE 0.
Invalid Material (E)
w_stck_cnt-message = 'E'.
w_stck_cnt-msg_txt = 'Invalid Material'.
MODIFY t_stck_cnt FROM w_stck_cnt.
CONTINUE.
ENDIF.
SELECT SINGLE charg vfdat
INTO (lw_charg, lw_vfdat)
FROM mch1 "KOB01 - changed from MCHA
WHERE matnr = w_stck_cnt-matnr
AND charg = w_stck_cnt-charg.
AND werks = w_stck_cnt-werks.
IF sy-subrc NE 0.
Invalid Material Batch (E)
w_stck_cnt-message = 'E'.
CONCATENATE 'Invalid Material Batch for plant' w_stck_cnt-werks
INTO w_stck_cnt-msg_txt SEPARATED BY space.
MODIFY t_stck_cnt FROM w_stck_cnt.
CONTINUE.
ELSE.
IF w_stck_cnt-vfdat <> lw_vfdat.
Sell by dates do not match (W)
w_stck_cnt-message = 'W'.
w_stck_cnt-msg_txt =
'Sell by Date does not match Shelf life Expiry Date'.
MODIFY t_stck_cnt FROM w_stck_cnt.
lv_sell = 'X'. "RM191006
CONTINUE. "RM191006
ENDIF.
ENDIF.
IF w_stck_cnt-quarn > 0.
Quarantine balance not Zero (W)
w_stck_cnt-message = 'W'.
*-- Begin RM191006
*-- We do want all warning messages on the report
lv_qty = w_stck_cnt-quarn.
CONDENSE lv_qty NO-GAPS.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = lv_qty
IMPORTING
output = lv_qty.
w_stck_cnt-msg_txt = 'Quarantine balance is not zero'.
CONCATENATE 'Quarantine balance is ' lv_qty '- not zero'
INTO w_stck_cnt-msg_txt SEPARATED BY space.
MODIFY t_stck_cnt FROM w_stck_cnt.
CONTINUE.
IF lv_sell = 'X'.
APPEND w_stck_cnt TO d_stck_cnt.
CLEAR lv_sell.
ELSE.
MODIFY t_stck_cnt FROM w_stck_cnt.
ENDIF.
*-- End RM191006
ENDIF.
ENDLOOP.
*-- Begin RM191006
*-- Finally get all the records into dummy table to report
APPEND LINES OF t_stck_cnt TO d_stck_cnt.
SORT d_stck_cnt.
DELETE ADJACENT DUPLICATES FROM d_stck_cnt.
*-- End RM191006
ENDFORM. " process_checks
*& Form file_check_report
Write warning and Error messages from File checks
FORM file_check_report.
WRITE: /2 'Material',
22 'Batch',
32 'Sell By',
45 'Message Text'.
WRITE: /2 sy-uline(115).
SKIP.
LOOP AT t_stck_cnt INTO w_stck_cnt. "RM191006
LOOP AT d_stck_cnt INTO w_stck_cnt. "RM191006
CHECK w_stck_cnt-message NE ' '.
WRITE: /2 w_stck_cnt-matnr,
22 w_stck_cnt-charg,
32 w_stck_cnt-vfdat,
43 w_stck_cnt-message,
45 w_stck_cnt-msg_txt.
ENDLOOP.
ENDFORM. " file_check_report
*& Form post_process_checks
Check Material Batches in SAP against NP File
FORM post_process_checks.
RANGES: r_matnr FOR mchb-matnr,
r_lgort FOR mchb-lgort,
r_werks FOR mchb-werks.
SORT t_stck_cnt.
LOOP AT t_stck_cnt INTO w_stck_cnt.
AT END OF matnr.
r_lgort-sign = 'I'.
r_lgort-option = 'EQ'.
r_lgort-low = w_stck_cnt-lgort.
APPEND r_lgort.
r_werks-sign = 'I'.
r_werks-option = 'EQ'.
r_werks-low = w_stck_cnt-werks.
APPEND r_werks.
r_matnr-sign = 'I'.
r_matnr-option = 'EQ'.
r_matnr-low = w_stck_cnt-matnr.
APPEND r_matnr.
ENDAT.
ENDLOOP.
Select all material batches for NP Materials
SELECT matnr charg clabs
INTO TABLE t_batch_errors
FROM mchb
WHERE werks IN r_werks
AND lgort IN r_lgort.
IF sy-subrc EQ 0.
Check if the Material Batches are in the NP file
LOOP AT t_batch_errors INTO w_batch_errors.
Disregard Batches without positive unrestricted stock
IF w_batch_errors-clabs LE 0.
DELETE t_batch_errors.
CONTINUE.
ENDIF.
READ TABLE t_stck_cnt INTO w_stck_cnt
WITH KEY matnr = w_batch_errors-matnr
charg = w_batch_errors-charg.
IF sy-subrc = 0.
DELETE t_batch_errors.
ENDIF.
ENDLOOP.
ENDIF.
CHECK NOT t_batch_errors[] IS INITIAL.
Write Batch chak results to report
SKIP.
WRITE: / text-b02.
WRITE: / sy-uline(74).
WRITE: /2 'Material',
22 'Batch'.
WRITE: /2 sy-uline(32).
SKIP.
LOOP AT t_batch_errors INTO w_batch_errors.
WRITE: /2 w_batch_errors-matnr,
22 w_batch_errors-charg.
ENDLOOP.
ENDFORM. " post_process_checks
G E T _ I N T E R F A C E _ F I L E N A M E
FORM get_interface_filename USING filename lw_path.
DATA: i_file TYPE filename-fileintern,
out_filename LIKE v_path-pathextern.
CLEAR: out_filename.
i_file = filename.
get the interface filename to be used when creating file
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
logical_filename = i_file
IMPORTING
file_name = out_filename
EXCEPTIONS
file_not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
MOVE out_filename TO lw_path.
IF filename NE c_archive_file. "RM080107
CONCATENATE lw_path 'NP_StockBalance.dat'
INTO lw_path.
*-- Begin RM080107 - Add timestamp to the archived file
ELSE.
CONCATENATE lw_path 'NP_StockBalance' sy-datum sy-uzeit '.dat'
INTO lw_path.
ENDIF.
*-- End RM080107
ELSE.
ENDIF.
ENDFORM. "get_interface_filename
*& Form move_file RM080107
Move the processed file to archive directory
FORM move_file.
*-- At last move the file to archive directory
OPEN DATASET p_arch FOR OUTPUT IN TEXT MODE.
IF sy-subrc = 0.
LOOP AT t_rawdata INTO w_rawdata.
TRANSFER w_rawdata TO p_arch.
ENDLOOP.
ENDIF.
CLOSE DATASET p_arch.
DELETE DATASET p_file.
ENDFORM. " move_fileHi,
S E L E C T I O N S C R E E N
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: p_file LIKE rlgrap-filename,
p_arch LIKE rlgrap-filename. "RM080107
SELECTION-SCREEN SKIP.
PARAMETERS: p_mode LIKE ctu_params-dismode DEFAULT 'N'.
SELECTION-SCREEN END OF BLOCK b1.
I N C L U D E S
INCLUDE zwm_np_stock_recon_top.
INCLUDE zwm_np_stock_recon_f01.
I N I T I A L I Z A T I O N
INITIALIZATION.
PERFORM get_interface_filename USING c_interface_file p_file.
PERFORM get_interface_filename USING c_archive_file p_arch."RM080107
S T A R T O F S E L E C T I O N
START-OF-SELECTION.
PERFORM read_file USING p_file.
PERFORM pre_processing.
E N D O F S E L E C T I O N
END-OF-SELECTION.
PERFORM process_checks.
IF w_no_change = 'X'.
WRITE: / text-b03.
WRITE: / sy-uline(34).
ELSE.
PERFORM bdc_mi09.
PERFORM file_check_report.
PERFORM bdc_report.
ENDIF.
PERFORM post_process_checks.
*-- Move the processed file to archive directory
PERFORM move_file.
...*************.........first include...................************
INCLUDE ZWM_NP_STOCK_RECON_TOP *
Data declaration ----------------------------------------------
TYPES: st_rawdata(2000) TYPE c.
TYPES: BEGIN OF st_stck_cnt,
werks TYPE iseg-werks, "plant
lgort TYPE iseg-lgort, "storage location
matnr TYPE iseg-matnr, "material number
charg TYPE iseg-charg, "batch
vfdat TYPE mch1-vfdat, "Sell by date
lwedt TYPE mch1-lwedt, "Manufacture date
quarn(8) TYPE n, "qaunrantine quantity
menge(8) TYPE n, "quantity on hand
message(1), "Message Type (E/W/I)
msg_txt TYPE t100-text, "Message Text
zerostck(1), "Zero stock identifier "RM220307
END OF st_stck_cnt.
TYPES: BEGIN OF st_batch_errors,
matnr TYPE iseg-matnr, "material number
charg TYPE iseg-charg, "batch
clabs TYPE mchb-clabs, "Stock Balance
END OF st_batch_errors.
DATA:
t_rawdata TYPE TABLE OF st_rawdata,
w_rawdata TYPE st_rawdata,
t_stck_cnt TYPE TABLE OF st_stck_cnt,
d_stck_cnt TYPE TABLE OF st_stck_cnt, "RM191006
w_stck_cnt TYPE st_stck_cnt,
t_batch_errors TYPE TABLE OF st_batch_errors,
w_batch_errors TYPE st_batch_errors,
t_messtab LIKE bdcmsgcoll OCCURS 0,
w_messtab LIKE LINE OF t_messtab,
w_no_change.
CONSTANTS: c_interface_file(26) TYPE c VALUE 'ZNP_STOCK_RECON',
c_archive_file(26) TYPE c
VALUE 'ZNP_STOCK_RECON_ARCHIVE'. "RM080107
.*************................second include..........************
***INCLUDE ZWM_NEXTPHARMA_STOKRECON_F01 .
*& Form read_file
reads NextPharma file sent through via webmethods
-->P_FILENAME
FORM read_file USING p_filename.
CLEAR: t_rawdata,
w_rawdata.
REFRESH: t_rawdata.
OPEN DATASET p_filename FOR INPUT IN TEXT MODE.
IF sy-subrc <> 0.
MESSAGE e720(01).
ENDIF.
DO.
READ DATASET p_filename INTO w_rawdata.
IF sy-subrc <> 0.
EXIT.
ELSE.
APPEND w_rawdata TO t_rawdata.
ENDIF.
ENDDO.
CLOSE DATASET p_filename.
ENDFORM. " read_file
*& Form pre_processing
Read file values into internal table
FORM pre_processing.
DATA: lw_matnr TYPE iseg-matnr.
LOOP AT t_rawdata INTO w_rawdata.
lw_matnr = w_rawdata+21(20). "RM031006
lw_matnr = w_rawdata+22(18). "RM031006
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = lw_matnr
IMPORTING
output = lw_matnr
EXCEPTIONS
length_error = 1
OTHERS = 2.
MOVE: lw_matnr TO w_stck_cnt-matnr.
w_stck_cnt-werks = w_rawdata+14(4).
w_stck_cnt-lgort = w_rawdata+18(4).
w_stck_cnt-charg = w_rawdata+84(25).
w_stck_cnt-vfdat = w_rawdata+109(8).
w_stck_cnt-lwedt = w_rawdata+117(8).
w_stck_cnt-quarn = w_rawdata+141(8).
w_stck_cnt-menge = w_rawdata+125(8).
APPEND w_stck_cnt TO t_stck_cnt.
CLEAR w_stck_cnt.
ENDLOOP.
SORT t_stck_cnt BY werks
lgort
matnr
charg.
DELETE ADJACENT DUPLICATES FROM t_stck_cnt.
ENDFORM. " pre_processing
*& Form bdc_mi09
Run file data via BDC TCODE: MI09
FORM bdc_mi09.
DATA: t_bdcdata TYPE TABLE OF bdcdata,
w_bdcdata TYPE bdcdata,
lw_datum(10) TYPE c,
lw_count(2) TYPE n.
WRITE sy-datum TO lw_datum DD/MM/YYYY.
<b>select single MATNR
WERKS
CHARG
from MCHA
into (l_matnr, l_werks, l_charg)
where matnr = w_stck_cnt-matnr
and werks = w_stck_cnt-werks.
and charg = w_stck_cnt-charg.
if sy-subrc ne 0.
continue.
endif.</b>
Front Screen
CLEAR w_bdcdata.
w_bdcdata-program = 'SAPMM07I'.
w_bdcdata-dynpro = '0700'.
w_bdcdata-dynbegin = 'X'.
APPEND w_bdcdata TO t_bdcdata.
Enter
CLEAR w_bdcdata.
w_bdcdata-fnam = 'BDC_OKCODE'.
w_bdcdata-fval = '/00'.
APPEND w_bdcdata TO t_bdcdata.
Count Date
CLEAR w_bdcdata.
w_bdcdata-fnam = 'RM07I-ZLDAT'.
w_bdcdata-fval = lw_datum.
APPEND w_bdcdata TO t_bdcdata.
Document Date
CLEAR w_bdcdata.
w_bdcdata-fnam = 'RM07I-BLDAT'.
w_bdcdata-fval = lw_datum.
APPEND w_bdcdata TO t_bdcdata.
Plant
CLEAR w_bdcdata.
w_bdcdata-fnam = 'IKPF-WERKS'.
w_bdcdata-fval = w_stck_cnt-werks.
APPEND w_bdcdata TO t_bdcdata.
Storage Location
CLEAR w_bdcdata.
w_bdcdata-fnam = 'IKPF-LGORT'.
w_bdcdata-fval = w_stck_cnt-lgort.
APPEND w_bdcdata TO t_bdcdata.
LOOP AT t_stck_cnt INTO w_stck_cnt.
Do not submit items with Errors against them
CHECK w_stck_cnt-message NE 'E' AND
w_stck_cnt-zerostck NE 'X'.
"RM220307
lw_count = lw_count + 1.
Input Screen
CLEAR w_bdcdata.
w_bdcdata-program = 'SAPMM07I'.
w_bdcdata-dynpro = '0731'.
w_bdcdata-dynbegin = 'X'.
APPEND w_bdcdata TO t_bdcdata.
Page Down
CLEAR w_bdcdata.
w_bdcdata-fnam = 'BDC_OKCODE'.
w_bdcdata-fval = '=P+'.
APPEND w_bdcdata TO t_bdcdata.
Material
CLEAR w_bdcdata.
w_bdcdata-fnam = 'ISEG-MATNR(01)'.
w_bdcdata-fval = w_stck_cnt-matnr.
APPEND w_bdcdata TO t_bdcdata.
Batch
CLEAR w_bdcdata.
w_bdcdata-fnam = 'ISEG-CHARG(01)'.
w_bdcdata-fval = w_stck_cnt-charg.
APPEND w_bdcdata TO t_bdcdata.
IF w_stck_cnt-menge NE 0.
Quantity
CLEAR w_bdcdata.
w_bdcdata-fnam = 'ISEG-ERFMG(01)'.
w_bdcdata-fval = w_stck_cnt-menge.
APPEND w_bdcdata TO t_bdcdata.
*-- Begin RM220307 - We need to create an item when the quantity is zero
*-- in file and is non-zero in SAP
ELSE.
Zero Stock indicator
CLEAR w_bdcdata.
w_bdcdata-fnam = 'ISEG-XNULL(01)'.
w_bdcdata-fval = 'X'.
APPEND w_bdcdata TO t_bdcdata.
*-- End RM220307
ENDIF.
ENDLOOP.
CHECK lw_count NE 0.
After all line items have been input
Final Screen
CLEAR w_bdcdata.
w_bdcdata-program = 'SAPMM07I'.
w_bdcdata-dynpro = '0731'.
w_bdcdata-dynbegin = 'X'.
APPEND w_bdcdata TO t_bdcdata.
Save Document
CLEAR w_bdcdata.
w_bdcdata-fnam = 'BDC_OKCODE'.
w_bdcdata-fval = '=BU'.
APPEND w_bdcdata TO t_bdcdata.
CALL TRANSACTION 'MI09' USING t_bdcdata
MODE p_mode
MESSAGES INTO t_messtab.
ENDFORM. " bdc_mi09
*& Form bdc_report
Write BDC Messages.
FORM bdc_report.
DATA: lw_text TYPE t100-text.
SKIP.
WRITE: / text-b01.
WRITE: / sy-uline(21).
SKIP.
Write BDC Messages
LOOP AT t_messtab INTO w_messtab WHERE msgspra = sy-langu.
MESSAGE ID w_messtab-msgid TYPE w_messtab-msgtyp
NUMBER w_messtab-msgnr
WITH w_messtab-msgv1
w_messtab-msgv2
w_messtab-msgv3
w_messtab-msgv4
INTO lw_text.
WRITE: / lw_text.
ENDLOOP.
ENDFORM. " bdc_report
*& Form process_checks
Perform process check before creating BDC Session
FORM process_checks.
DATA: lw_clabs LIKE mchb-clabs,
lw_menge LIKE mchb-clabs,
lw_matnr LIKE mara-matnr,
lw_charg LIKE mch1-charg,
lw_fail,
lw_vfdat TYPE mch1-vfdat,
lv_sell TYPE c, "RM191006
lv_qty(8) TYPE c. "RM191006
CLEAR: d_stck_cnt[], d_stck_cnt. "RM191006
Check if any of the stock figures differ from current stock figures
LOOP AT t_stck_cnt INTO w_stck_cnt.
lw_menge = w_stck_cnt-menge.
SELECT SINGLE clabs INTO lw_clabs
FROM mchb
WHERE matnr = w_stck_cnt-matnr
AND werks = w_stck_cnt-werks
AND lgort = w_stck_cnt-lgort
AND charg = w_stck_cnt-charg.
IF sy-subrc = 0.
IF lw_clabs NE lw_menge.
lw_fail = 'X'.
*-- Begin RM220307 - Do not create PI item if the stock is zero in the
*-- file and is zero in SAP
EXIT.
ELSEIF lw_clabs = 0 AND lw_menge = 0.
w_stck_cnt-zerostck = 'X'.
MODIFY t_stck_cnt FROM w_stck_cnt.
ENDIF.
*-- End RM220307
ELSE.
lw_fail = 'X'.
ERROR
ENDIF.
ENDLOOP.
If no differences are found set NO CHANGE Flag
IF lw_fail NE 'X'.
w_no_change = 'X'.
EXIT.
ENDIF.
Check for Errors in file data
LOOP AT t_stck_cnt INTO w_stck_cnt.
CLEAR lv_sell. "RM191006
SELECT SINGLE matnr INTO lw_matnr
FROM mara
WHERE matnr = w_stck_cnt-matnr.
IF sy-subrc NE 0.
Invalid Material (E)
w_stck_cnt-message = 'E'.
w_stck_cnt-msg_txt = 'Invalid Material'.
MODIFY t_stck_cnt FROM w_stck_cnt.
CONTINUE.
ENDIF.
SELECT SINGLE charg vfdat
INTO (lw_charg, lw_vfdat)
FROM mch1 "KOB01 - changed from MCHA
WHERE matnr = w_stck_cnt-matnr
AND charg = w_stck_cnt-charg.
AND werks = w_stck_cnt-werks.
IF sy-subrc NE 0.
Invalid Material Batch (E)
w_stck_cnt-message = 'E'.
CONCATENATE 'Invalid Material Batch for plant' w_stck_cnt-werks
INTO w_stck_cnt-msg_txt SEPARATED BY space.
MODIFY t_stck_cnt FROM w_stck_cnt.
CONTINUE.
ELSE.
IF w_stck_cnt-vfdat <> lw_vfdat.
Sell by dates do not match (W)
w_stck_cnt-message = 'W'.
w_stck_cnt-msg_txt =
'Sell by Date does not match Shelf life Expiry Date'.
MODIFY t_stck_cnt FROM w_stck_cnt.
lv_sell = 'X'. "RM191006
CONTINUE. "RM191006
ENDIF.
ENDIF.
IF w_stck_cnt-quarn > 0.
Quarantine balance not Zero (W)
w_stck_cnt-message = 'W'.
*-- Begin RM191006
*-- We do want all warning messages on the report
lv_qty = w_stck_cnt-quarn.
CONDENSE lv_qty NO-GAPS.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = lv_qty
IMPORTING
output = lv_qty.
w_stck_cnt-msg_txt = 'Quarantine balance is not zero'.
CONCATENATE 'Quarantine balance is ' lv_qty '- not zero'
INTO w_stck_cnt-msg_txt SEPARATED BY space.
MODIFY t_stck_cnt FROM w_stck_cnt.
CONTINUE.
IF lv_sell = 'X'.
APPEND w_stck_cnt TO d_stck_cnt.
CLEAR lv_sell.
ELSE.
MODIFY t_stck_cnt FROM w_stck_cnt.
ENDIF.
*-- End RM191006
ENDIF.
ENDLOOP.
*-- Begin RM191006
*-- Finally get all the records into dummy table to report
APPEND LINES OF t_stck_cnt TO d_stck_cnt.
SORT d_stck_cnt.
DELETE ADJACENT DUPLICATES FROM d_stck_cnt.
*-- End RM191006
ENDFORM. " process_checks
*& Form file_check_report
Write warning and Error messages from File checks
FORM file_check_report.
WRITE: /2 'Material',
22 'Batch',
32 'Sell By',
45 'Message Text'.
WRITE: /2 sy-uline(115).
SKIP.
LOOP AT t_stck_cnt INTO w_stck_cnt. "RM191006
LOOP AT d_stck_cnt INTO w_stck_cnt. "RM191006
CHECK w_stck_cnt-message NE ' '.
WRITE: /2 w_stck_cnt-matnr,
22 w_stck_cnt-charg,
32 w_stck_cnt-vfdat,
43 w_stck_cnt-message,
45 w_stck_cnt-msg_txt.
ENDLOOP.
ENDFORM. " file_check_report
*& Form post_process_checks
Check Material Batches in SAP against NP File
FORM post_process_checks.
RANGES: r_matnr FOR mchb-matnr,
r_lgort FOR mchb-lgort,
r_werks FOR mchb-werks.
SORT t_stck_cnt.
LOOP AT t_stck_cnt INTO w_stck_cnt.
AT END OF matnr.
r_lgort-sign = 'I'.
r_lgort-option = 'EQ'.
r_lgort-low = w_stck_cnt-lgort.
APPEND r_lgort.
r_werks-sign = 'I'.
r_werks-option = 'EQ'.
r_werks-low = w_stck_cnt-werks.
APPEND r_werks.
r_matnr-sign = 'I'.
r_matnr-option = 'EQ'.
r_matnr-low = w_stck_cnt-matnr.
APPEND r_matnr.
ENDAT.
ENDLOOP.
Select all material batches for NP Materials
SELECT matnr charg clabs
INTO TABLE t_batch_errors
FROM mchb
WHERE werks IN r_werks
AND lgort IN r_lgort.
IF sy-subrc EQ 0.
Check if the Material Batches are in the NP file
LOOP AT t_batch_errors INTO w_batch_errors.
Disregard Batches without positive unrestricted stock
IF w_batch_errors-clabs LE 0.
DELETE t_batch_errors.
CONTINUE.
ENDIF.
READ TABLE t_stck_cnt INTO w_stck_cnt
WITH KEY matnr = w_batch_errors-matnr
charg = w_batch_errors-charg.
IF sy-subrc = 0.
DELETE t_batch_errors.
ENDIF.
ENDLOOP.
ENDIF.
CHECK NOT t_batch_errors[] IS INITIAL.
Write Batch chak results to report
SKIP.
WRITE: / text-b02.
WRITE: / sy-uline(74).
WRITE: /2 'Material',
22 'Batch'.
WRITE: /2 sy-uline(32).
SKIP.
LOOP AT t_batch_errors INTO w_batch_errors.
WRITE: /2 w_batch_errors-matnr,
22 w_batch_errors-charg.
ENDLOOP.
ENDFORM. " post_process_checks
G E T _ I N T E R F A C E _ F I L E N A M E
FORM get_interface_filename USING filename lw_path.
DATA: i_file TYPE filename-fileintern,
out_filename LIKE v_path-pathextern.
CLEAR: out_filename.
i_file = filename.
get the interface filename to be used when creating file
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
logical_filename = i_file
IMPORTING
file_name = out_filename
EXCEPTIONS
file_not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
MOVE out_filename TO lw_path.
IF filename NE c_archive_file. "RM080107
CONCATENATE lw_path 'NP_StockBalance.dat'
INTO lw_path.
*-- Begin RM080107 - Add timestamp to the archived file
ELSE.
CONCATENATE lw_path 'NP_StockBalance' sy-datum sy-uzeit '.dat'
INTO lw_path.
ENDIF.
*-- End RM080107
ELSE.
ENDIF.
ENDFORM. "get_interface_filename
*& Form move_file RM080107
Move the processed file to archive directory
FORM move_file.
*-- At last move the file to archive directory
OPEN DATASET p_arch FOR OUTPUT IN TEXT MODE.
IF sy-subrc = 0.
LOOP AT t_rawdata INTO w_rawdata.
TRANSFER w_rawdata TO p_arch.
ENDLOOP.
ENDIF.
CLOSE DATASET p_arch.
DELETE DATASET p_file.
ENDFORM. " move_file
Best regards,
Prashant
Maybe you are looking for
-
First thing I noticed was that after every attempt to send a text, immediatly after tapping send I was flashed back to my home screen - no text saved or sent. So I tried reset. I tried from icloud , but wouldnt work, just kept prompting me for apple
-
Hi, We Recently upgraded our R/3 System from 4.6 C to ECC 6.0. Shopping card number is getting created in SRM side and after approval it is getting sent to R/3 Back end,We have some customer fields that need to be populated in the back end from t
-
Run-Time Engine Installati​on ?
I currently have LabVIEW Developer Suite 6.0 for both PC (Windows NT/2000) and the Mac OS . We are developping a number of executables that will be run on Windows NT 4.0 hosts . I have a few questions. 1.) Is there an installer for the run-time engin
-
Ipad and itunes smart playlists
Hello I made a smart playlist which includes all podcasts with a certain word in the title like "News". I also have another smart playlist which includes all items from the first playlist, with an added criterion of never having been played before, a
-
Can report program trigger a job and then a job trigger another report?
Actually I'd like one ABAP4 report program trigger another ABAP4 report program and yesterday some people here suggested me to use SUBMIT statement at the end of the source program, but if we don't want to touch the source code of the source program,